How to use the graphql-tool-utilities.isOperation function in graphql-tool-utilities

To help you get started, we’ve selected a few graphql-tool-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-typescript-definitions / src / print / document / context.ts View on Github external
get typeName() {
    let typeName: string;

    if (isOperation(this.operation)) {
      const {operationName, operationType} = this.operation;
      typeName = `${ucFirst(operationName)}${ucFirst(operationType)}Data`;
    } else {
      const {fragmentName} = this.operation;
      typeName = `${ucFirst(fragmentName)}FragmentData`;
    }

    return this.options.partial
      ? typeName.replace(/Data$/, 'PartialData')
      : typeName;
  }

graphql-tool-utilities

Common utilities for GraphQL developer tools

MIT
Latest version published 4 months ago

Package Health Score

56 / 100
Full package analysis

Similar packages