How to use @graphback/codegen-schema - 3 common examples

To help you get started, we’ve selected a few @graphback/codegen-schema examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github aerogear / graphback / packages / graphback / src / GraphQLBackendCreator.ts View on Github external
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;
  }
github aerogear / graphback / packages / graphback / src / GraphQLBackendCreator.ts View on Github external
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;
  }
github Urigo / graphql-cli / packages / commands / generate / src / index.ts View on Github external
export async function createBackendFiles(cwd: string, inputContext: InputModelTypeContext[], config: GenerateConfig) {
  const resolvers = createResolvers(inputContext, config.generator.resolvers);
  const schema = createSchema(inputContext, config.generator.schema);

  await Promise.all([
    createSchemaFile(cwd, schema, config),
    createResolversFiles(cwd, resolvers, config)
  ])
}

@graphback/codegen-schema

GraphQL-Code-Generator compatibile schema generator

Apache-2.0
Latest version published 4 years ago

Package Health Score

45 / 100
Full package analysis

Similar packages