Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
options.autoSchemaFile,
options.buildSchemaOptions,
this.resolversExplorerService.getAllCtors(),
);
const executableSchema = makeExecutableSchema({
resolvers: extend(typesResolvers, options.resolvers),
typeDefs: gql`
${printSchema(autoGeneratedSchema)}
`,
resolverValidationOptions: {
...(options.resolverValidationOptions || {}),
requireResolversForResolveType: false,
},
});
let schema = options.schema
? mergeSchemas({
schemas: [options.schema, executableSchema],
})
: executableSchema;
const autoGeneratedSchemaConfig = autoGeneratedSchema.toConfig();
const executableSchemaConfig = executableSchema.toConfig();
const schemaConfig = this.overrideOrExtendResolvers(
executableSchemaConfig,
autoGeneratedSchemaConfig,
);
schema = new GraphQLSchema(schemaConfig);
return {
...options,
typeDefs: undefined,
schema: await transformSchema(schema),
...options,
typeDefs: undefined,
schema: await transformSchema(options.schema),
};
}
const executableSchema = makeExecutableSchema({
resolvers: extend(typesResolvers, options.resolvers),
directiveResolvers: options.directiveResolvers,
schemaDirectives: options.schemaDirectives as any,
typeDefs: gql`
${options.typeDefs}
`,
resolverValidationOptions: options.resolverValidationOptions,
});
const schema = options.schema
? mergeSchemas({
schemas: [options.schema, executableSchema],
})
: executableSchema;
removeTempField(schema);
return {
...options,
typeDefs: undefined,
schema: await transformSchema(schema),
};
}