GraphiQL API Documentation
    Preparing search index...

    Utilities useful for language services across runtimes

    • extract all operation nodes, and if schema is present, variable definitions, in a map

      Parameters

      • documentAST: DocumentNode

        {DocumentNode} a graphql-js compatible AST node

      • Optionalschema: GraphQLSchema | null

        {GraphQLSchema} optional schema

      Returns OperationASTFacts

       const { variablesToType, operations } = getOperationASTFacts(
      parse('documentString'),
      );
      operations.forEach(op => {
      console.log(op.name, op.operation, op.loc);
      });
      Object.entries(variablesToType).forEach(([variableName, type]) => {
      console.log(variableName, type);
      });