graphql-language-service-utils

  • Version 2.7.1
  • Published
  • 126 kB
  • 3 dependencies
  • MIT license

Install

npm i graphql-language-service-utils
yarn add graphql-language-service-utils
pnpm add graphql-language-service-utils

Overview

Utilities to support the GraphQL Language Service

Index

Variables

variable getQueryFacts

const getQueryFacts: (schema?: any, documentString?: string) => OperationFacts;

    Functions

    function collectVariables

    collectVariables: (schema: any, documentAST: any) => VariableToType;

      function getASTNodeAtPosition

      getASTNodeAtPosition: (
      query: string,
      ast: any,
      point: any
      ) => ASTNode | undefined;

        function getFragmentDependencies

        getFragmentDependencies: (
        operationString: string,
        fragmentDefinitions?: Map<string, FragmentDefinitionNode> | null | undefined
        ) => FragmentDefinitionNode[];

          function getFragmentDependenciesForAST

          getFragmentDependenciesForAST: (
          parsedOperation: any,
          fragmentDefinitions: Map<string, FragmentDefinitionNode>
          ) => FragmentDefinitionNode[];

            function getOperationASTFacts

            getOperationASTFacts: (
            documentAST: any,
            schema?: GraphQLSchema | null
            ) => OperationASTFacts;

              function getOperationFacts

              getOperationFacts: (
              schema?: GraphQLSchema | null,
              documentString?: string | null
              ) => OperationFacts | undefined;

                function getVariablesJSONSchema

                getVariablesJSONSchema: (
                variableToType: VariableToType,
                options?: JSONSchemaOptions
                ) => any;

                  function locToRange

                  locToRange: (text: string, loc: any) => Range;

                    function offsetToPosition

                    offsetToPosition: (text: string, loc: number) => Position;

                      function pointToOffset

                      pointToOffset: (text: string, point: any) => number;

                        function validateWithCustomRules

                        validateWithCustomRules: (
                        schema: any,
                        ast: any,
                        customRules?: Array<ValidationRule> | null,
                        isRelayCompatMode?: boolean,
                        isSchemaDocument?: boolean
                        ) => Array<GraphQLError>;

                          Classes

                          class Position

                          class Position implements IPosition {}

                            constructor

                            constructor(line: number, character: number);

                              property character

                              character: number;

                                property lessThanOrEqualTo

                                lessThanOrEqualTo: (position: any) => boolean;

                                  property line

                                  line: number;

                                    method setCharacter

                                    setCharacter: (character: number) => void;

                                      method setLine

                                      setLine: (line: number) => void;

                                        class Range

                                        class Range implements IRange {}

                                          constructor

                                          constructor(start: any, end: any);

                                            property containsPosition

                                            containsPosition: (position: any) => boolean;

                                              property end

                                              end: any;

                                                property start

                                                start: any;

                                                  method setEnd

                                                  setEnd: (line: number, character: number) => void;

                                                    method setStart

                                                    setStart: (line: number, character: number) => void;

                                                      Type Aliases

                                                      type JSONSchemaOptions

                                                      type JSONSchemaOptions = {
                                                      useMarkdownDescription?: boolean;
                                                      };

                                                        type OperationFacts

                                                        type OperationFacts = {
                                                        documentAST: DocumentNode;
                                                        } & OperationASTFacts;

                                                          type QueryFacts

                                                          type QueryFacts = OperationFacts;

                                                            type VariableToType

                                                            type VariableToType = {
                                                            [variable: string]: GraphQLInputType;
                                                            };

                                                              Package Files (8)

                                                              Dependencies (3)

                                                              Dev Dependencies (2)

                                                              Peer Dependencies (1)

                                                              Badge

                                                              To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                                              You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/graphql-language-service-utils.

                                                              • Markdown
                                                                [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/graphql-language-service-utils)
                                                              • HTML
                                                                <a href="https://www.jsdocs.io/package/graphql-language-service-utils"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>