How to use the @graphql-box/helpers.hasFragmentDefinitions function in @graphql-box/helpers

To help you get started, we’ve selected a few @graphql-box/helpers 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 badbatch / graphql-box / packages / request-parser / src / main / index.ts View on Github external
private static _getFragmentDefinitions(
    node: DocumentNode,
    { fragments }: RequestOptions,
  ): FragmentDefinitionNodeMap | undefined {
    if (!fragments && !hasFragmentDefinitions(node)) return undefined;

    return getFragmentDefinitions(node);
  }
github badbatch / graphql-box / packages / request-parser / src / main / index.ts View on Github external
private static _deleteFragmentDefinitions(
    node: DocumentNode,
    { fragments }: RequestOptions,
  ): DocumentNode | undefined {
    if (!fragments && !hasFragmentDefinitions(node)) return undefined;

    return deleteFragmentDefinitions(node);
  }