How to use the graphql-config.GraphQLConfig function in graphql-config

To help you get started, we’ve selected a few graphql-config 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 prisma-labs / graphql-config-extension-prisma / src / index.ts View on Github external
projects: {
      [serviceName]: {
        schemaPath: '',
        extensions: {
          endpoints: {
            [stage]: {
              url,
              headers,
            },
          },
        },
      },
    },
  }

  return new GraphQLConfig(data, '')
}
github aws-amplify / amplify-cli / packages / amplify-codegen / src / codegen-config / AmplifyCodeGenConfig.js View on Github external
constructor(context, withoutInit = false) {
    try {
      this.gqlConfig = graphQLConfig.getGraphQLConfig();
      this.fixOldConfig();
    } catch (e) {
      if (e instanceof graphQLConfig.ConfigNotFoundError) {
        const { amplify } = context;
        let projectRoot;
        if (!withoutInit) {
          projectRoot = amplify.getEnvInfo().projectPath || process.cwd();
        } else {
          projectRoot = process.cwd();
        }
        const configPath = join(projectRoot, '.graphqlconfig.yml');
        this.gqlConfig = new graphQLConfig.GraphQLConfig(null, configPath);
        this.gqlConfig.config = {};
      } else {
        throw e;
      }
    }
  }
  static isValidAmplifyProject(project) {