Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
console.log(
argv.json
? JSON.stringify(newSchemaResult, null, 2)
: printSchema(newSchemaResult as GraphQLSchema),
)
} else if (argv.json) {
if (!fs.existsSync(schemaPath)) {
mkdirp.sync(dirname(schemaPath))
}
fs.writeFileSync(argv.output, JSON.stringify(newSchemaResult, null, 2))
} else {
schemaPath = schemaPath || config!.schemaPath
if (!fs.existsSync(schemaPath)) {
mkdirp.sync(dirname(schemaPath))
}
await writeSchema(schemaPath as string, newSchemaResult as GraphQLSchema, {
source: endpoint.url,
timestamp: new Date().toString(),
})
}
if (schemaPath) {
log(
chalk.green(
`${
config && config.projectName && config.projectName !== 'unnamed'
? `project ${chalk.blue(config.projectName)} - `
: ''
}${
endpointName && endpointName !== 'unnamed'
? `endpoint ${chalk.blue(endpointName)} - `
: ''