getOperationAST.d.ts 436 B

123456789101112
  1. import Maybe from '../tsutils/Maybe';
  2. import { DocumentNode, OperationDefinitionNode } from '../language/ast';
  3. /**
  4. * Returns an operation AST given a document AST and optionally an operation
  5. * name. If a name is not provided, an operation is only returned if only one is
  6. * provided in the document.
  7. */
  8. export function getOperationAST(
  9. documentAST: DocumentNode,
  10. operationName: Maybe<string>,
  11. ): Maybe<OperationDefinitionNode>;