Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
catch (e) { }
const schemas = [externalSchema, schema].filter(i => !!i);
let mergedSchemas;
if (schemas.length === 1) {
mergedSchemas = schema;
}
else {
mergedSchemas = core_1.mergeSchemas({
schemas
});
}
if (args_extractors_1.includes('--verbose')) {
console.log(`
Schema:
${core_1.printSchema(mergedSchemas)}
`);
}
if (process.argv.toString().includes('--generate')) {
util_1.promisify(fs_1.writeFile)('./schema.graphql', core_1.printSchema(mergedSchemas), {
encoding: 'utf-8'
}).then(() => {
console.log('Schema created!');
process.exit(0);
});
}
else {
console.log('You can extract this schema by running --generate command');
}
return mergedSchemas;
}
},
}
} catch (e) {}
const schemas = [externalSchema, schema].filter(i => !!i);
let mergedSchemas: GraphQLSchema;
if (schemas.length === 1) {
mergedSchemas = schema;
} else {
mergedSchemas = mergeSchemas({
schemas
});
}
if (includes('--verbose')) {
console.log(`
Schema:
${printSchema(mergedSchemas)}
`);
}
if (process.argv.toString().includes('--generate')) {
promisify(writeFile)('./schema.graphql', printSchema(mergedSchemas), {
encoding: 'utf-8'
}).then(() => {
console.log('Schema created!');
process.exit(0);
});
}
return mergedSchemas;
}
},
getViewsConfig(views?: ConfigViews) {
const config = Container.get('main-config-compiled');
return {
components: config.$components,
views: viewsToArray(views || config.$views),
schema: printSchema(Container.get(BootstrapService).schema)
};
}