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

To help you get started, we’ve selected a few @graphback/codegen-client 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 / graphql-testx / src / GraphbackClient.ts View on Github external
export async function initGraphbackClient(
  context: InputModelTypeContext[]
): Promise {
  const fragments: StringDic = {};
  const queries: StringDic = {};
  const mutations: StringDic = {};
  const subscriptions: StringDic = {};

  const client = await createClient(context, { output: "gqlwithfragment" });

  if (client.fragments !== undefined) {
    insertImplInto(client.fragments, fragments);
  }

  if (client.queries !== undefined) {
    insertImplInto(client.queries, queries);
  }

  if (client.mutations !== undefined) {
    insertImplInto(client.mutations, mutations);
  }

  if (client.subscriptions !== undefined) {
    insertImplInto(client.subscriptions, subscriptions);
  }
github Urigo / graphql-cli / packages / commands / generate / src / index.ts View on Github external
export async function createClientFiles(cwd: string, inputContext: InputModelTypeContext[], config: GenerateConfig) {
  const generated = await createClient(inputContext, { output: config.generator.client.format });
  await Promise.all([
    createFragments(cwd, generated, config),
    createQueries(cwd, generated, config),
    createMutations(cwd, generated, config),
    createSubscriptions(cwd, generated, config),
  ]);
}
github aerogear / graphback / packages / graphback / src / GraphQLBackendCreator.ts View on Github external
public async createClient(): Promise {
    return createClient(this.inputContext);
  }
}

@graphback/codegen-client

GraphQL-Code-Generator compatible client side queries generator

Apache-2.0
Latest version published 4 years ago

Package Health Score

45 / 100
Full package analysis

Popular @graphback/codegen-client functions

Similar packages