Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const gQlSdlCombined = this.gQlSdl.concat(this.gQlSdlExtensions.slice()).join('\n');
this.gQlAst = gQLHelper.helper.parseGraphQlSchema(gQlSdlCombined);
this.dbMeta = parseGQlAstToDbMeta(this.gQlAst);
// load permissions and expressions and generate views and put them into schemas
try {
// load permissions
const viewsPattern = this.ENVIRONMENT.path + this.graphQlConfig.viewsPattern;
const viewsArray = await helper.requireFilesByGlobPattern(viewsPattern);
this.views = [].concat.apply([], viewsArray);
// load expressions
const expressionsPattern = this.ENVIRONMENT.path + this.graphQlConfig.expressionsPattern;
const expressionsArray = await helper.requireFilesByGlobPattern(expressionsPattern);
this.expressions = [].concat.apply([], expressionsArray);
const viewSchemaName = Container.get(Config).getConfig('db').viewSchemaName;
const combinedSchemaInformation = runtimeParser(this.gQlAst, this.views, this.expressions, this.dbMeta, viewSchemaName, this.parsers);
this.gQlRuntimeDocument = combinedSchemaInformation.document;
this.gQlRuntimeSchema = gQLHelper.helper.printGraphQlDocument(this.gQlRuntimeDocument);
this.gQlTypes = combinedSchemaInformation.gQlTypes;
this.queries = combinedSchemaInformation.queries;
this.mutations = combinedSchemaInformation.mutations;
this.customOperations = {
fields: combinedSchemaInformation.customFields,
queries: combinedSchemaInformation.customQueries,
mutations: combinedSchemaInformation.customMutations
this.logger.warn('boot.no.sdl.files.found');
return;
}
// Combine all Schemas to a big one and add extensions from other modules
const gQlSdlCombined = this.gQlSdl.concat(this.gQlSdlExtensions.slice()).join('\n');
this.gQlAst = gQLHelper.helper.parseGraphQlSchema(gQlSdlCombined);
this.dbMeta = parseGQlAstToDbMeta(this.gQlAst);
// load permissions and expressions and generate views and put them into schemas
try {
// load permissions
const viewsPattern = this.ENVIRONMENT.path + this.graphQlConfig.viewsPattern;
const viewsArray = await helper.requireFilesByGlobPattern(viewsPattern);
this.views = [].concat.apply([], viewsArray);
// load expressions
const expressionsPattern = this.ENVIRONMENT.path + this.graphQlConfig.expressionsPattern;
const expressionsArray = await helper.requireFilesByGlobPattern(expressionsPattern);
this.expressions = [].concat.apply([], expressionsArray);
const viewSchemaName = Container.get(Config).getConfig('db').viewSchemaName;
const combinedSchemaInformation = runtimeParser(this.gQlAst, this.views, this.expressions, this.dbMeta, viewSchemaName, this.parsers);
this.gQlRuntimeDocument = combinedSchemaInformation.document;
this.gQlRuntimeSchema = gQLHelper.helper.printGraphQlDocument(this.gQlRuntimeDocument);
this.gQlTypes = combinedSchemaInformation.gQlTypes;
this.queries = combinedSchemaInformation.queries;
this.mutations = combinedSchemaInformation.mutations;