How to use graphql-config-utilities - 3 common examples

To help you get started, we’ve selected a few graphql-config-utilities 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 Shopify / graphql-tools-web / packages / graphql-validate-fixtures / src / index.ts View on Github external
async function getOperationsForProject(
  projectConfig: GraphQLProjectConfig,
): Promise {
  const operationPaths = await getGraphQLProjectIncludedFilePaths(
    projectConfig,
  );

  const operationSources = await Promise.all(
    operationPaths.map(loadOperationSource),
  );

  const document = concatAST(
    operationSources.map((source) => {
      try {
        return parse(source);
      } catch (error) {
        throw new Error(
          `Error parsing '${source.name}':\n\n${error.message.replace(
            /Syntax Error.*?\(.*?\) /,
            '',
github Shopify / graphql-tools-web / packages / graphql-validate-fixtures / src / index.ts View on Github external
export async function evaluateFixtures(
  fixturePaths: string[],
  {cwd}: Options,
): Promise {
  const config = getGraphQLConfig(resolve(cwd));

  const projectASTCollection = await Promise.all(
    getGraphQLProjects(config).map(getOperationsForProject),
  );

  return runForEachFixture(fixturePaths, (fixture) =>
    evaluateFixture(fixture, projectASTCollection),
  );
}
github Shopify / graphql-tools-web / packages / graphql-validate-fixtures / src / validate.ts View on Github external
          .map(({projectAST: {config}}) => resolveProjectName(config))
          .join(', ')}.`,

graphql-config-utilities

Common utilities for graphql-config

MIT
Latest version published 6 months ago

Package Health Score

56 / 100
Full package analysis

Similar packages