Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public async createRuntime(db: GraphbackDataProvider, pubSub: PubSub): Promise {
const backend: RuntimeResolversDefinition = {
schema: "",
resolvers: {}
};
const schemaGenerator = new SchemaGenerator(this.inputContext)
backend.schema = schemaGenerator.generate()
const defaultProvider = new CRUDService(db, pubSub);
const resolverGenerator = new LayeredRuntimeResolverGenerator(this.inputContext, defaultProvider)
backend.resolvers = resolverGenerator.generate()
return backend;
}
public async createBackend(resolverOptions: ResolverGeneratorOptions): Promise {
const backend: IGraphQLBackend = {};
const schemaGenerator = new SchemaGenerator(this.inputContext, tsSchemaFormatter)
backend.schema = schemaGenerator.generate()
backend.resolvers = createResolvers(this.inputContext, resolverOptions);
return backend;
}