graphql-language-service-interface

  • Version 2.10.2
  • Published
  • 392 kB
  • 5 dependencies
  • MIT license

Install

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

Overview

Interface to the GraphQL Language Service

Index

Variables

variable DIAGNOSTIC_SEVERITY

const DIAGNOSTIC_SEVERITY: {
Error: DiagnosticSeverity;
Warning: DiagnosticSeverity;
Information: DiagnosticSeverity;
Hint: DiagnosticSeverity;
};

    variable LANGUAGE

    const LANGUAGE: string;

      variable SEVERITY

      const SEVERITY: {
      Error: 'Error';
      Warning: 'Warning';
      Information: 'Information';
      Hint: 'Hint';
      };

        variable SuggestionCommand

        const SuggestionCommand: { command: string; title: string };

          Functions

          function canUseDirective

          canUseDirective: (state: State, directive: GraphQLDirective) => boolean;

            function forEachState

            forEachState: (
            stack: State,
            fn: (state: State) => AllTypeInfo | null | void
            ) => void;

              function getAutocompleteSuggestions

              getAutocompleteSuggestions: (
              schema: GraphQLSchema,
              queryText: string,
              cursor: IPosition,
              contextToken?: ContextTokenForCodeMirror,
              fragmentDefs?: FragmentDefinitionNode[] | string,
              options?: AutocompleteSuggestionOptions
              ) => Array<CompletionItem>;

                function getDefinitionQueryResultForDefinitionNode

                getDefinitionQueryResultForDefinitionNode: (
                path: Uri,
                text: string,
                definition: FragmentDefinitionNode | OperationDefinitionNode
                ) => DefinitionQueryResult;

                  function getDefinitionQueryResultForFragmentSpread

                  getDefinitionQueryResultForFragmentSpread: (
                  text: string,
                  fragment: FragmentSpreadNode,
                  dependencies: Array<FragmentInfo>
                  ) => Promise<DefinitionQueryResult>;

                    function getDefinitionQueryResultForNamedType

                    getDefinitionQueryResultForNamedType: (
                    text: string,
                    node: NamedTypeNode,
                    dependencies: Array<ObjectTypeInfo>
                    ) => Promise<DefinitionQueryResult>;

                      function getDefinitionState

                      getDefinitionState: (tokenState: State) => State | null | undefined;

                        function getDiagnostics

                        getDiagnostics: (
                        query: string,
                        schema?: GraphQLSchema | null | undefined,
                        customRules?: Array<ValidationRule>,
                        isRelayCompatMode?: boolean,
                        externalFragments?: FragmentDefinitionNode[] | string
                        ) => Array<Diagnostic>;

                          function getFieldDef

                          getFieldDef: (
                          schema: GraphQLSchema,
                          type: GraphQLType,
                          fieldName: string
                          ) => GraphQLField<any, any> | null | undefined;

                            function getFragmentDefinitions

                            getFragmentDefinitions: (queryText: string) => Array<FragmentDefinitionNode>;

                              function getHoverInformation

                              getHoverInformation: (
                              schema: GraphQLSchema,
                              queryText: string,
                              cursor: IPosition,
                              contextToken?: ContextToken,
                              config?: HoverConfig
                              ) => Hover;

                                function getOutline

                                getOutline: (documentText: string) => Outline | null;

                                  function getRange

                                  getRange: (location: SourceLocation, queryText: string) => IRange;

                                    function getTokenAtPosition

                                    getTokenAtPosition: (queryText: string, cursor: IPosition) => ContextToken;

                                      function getTypeInfo

                                      getTypeInfo: (schema: GraphQLSchema, tokenState: State) => AllTypeInfo;

                                        function getVariableCompletions

                                        getVariableCompletions: (
                                        queryText: string,
                                        schema: GraphQLSchema,
                                        token: ContextToken
                                        ) => CompletionItem[];

                                          function hintList

                                          hintList: <T extends CompletionItemBase>(
                                          token: ContextTokenUnion,
                                          list: Array<T>
                                          ) => Array<T>;

                                            function objectValues

                                            objectValues: <T>(object: Record<string, T>) => Array<T>;

                                              function runOnlineParser

                                              runOnlineParser: (queryText: string, callback: callbackFnType) => ContextToken;

                                                function validateQuery

                                                validateQuery: (
                                                ast: DocumentNode,
                                                schema?: GraphQLSchema | null | undefined,
                                                customRules?: Array<ValidationRule> | null,
                                                isRelayCompatMode?: boolean
                                                ) => Array<Diagnostic>;

                                                  Classes

                                                  class GraphQLLanguageService

                                                  class GraphQLLanguageService {}

                                                    constructor

                                                    constructor(cache: GraphQLCache);

                                                      method getAutocompleteSuggestions

                                                      getAutocompleteSuggestions: (
                                                      query: string,
                                                      position: IPosition,
                                                      filePath: Uri
                                                      ) => Promise<Array<CompletionItem>>;

                                                        method getConfigForURI

                                                        getConfigForURI: (uri: Uri) => GraphQLProjectConfig;

                                                          method getDefinition

                                                          getDefinition: (
                                                          query: string,
                                                          position: IPosition,
                                                          filePath: Uri
                                                          ) => Promise<DefinitionQueryResult | null>;

                                                            method getDiagnostics

                                                            getDiagnostics: (
                                                            query: string,
                                                            uri: Uri,
                                                            isRelayCompatMode?: boolean
                                                            ) => Promise<Array<Diagnostic>>;

                                                              method getDocumentSymbols

                                                              getDocumentSymbols: (
                                                              document: string,
                                                              filePath: Uri
                                                              ) => Promise<SymbolInformation[]>;

                                                                method getHoverInformation

                                                                getHoverInformation: (
                                                                query: string,
                                                                position: IPosition,
                                                                filePath: Uri,
                                                                options?: HoverConfig
                                                                ) => Promise<Hover['contents']>;

                                                                  method getOutline

                                                                  getOutline: (documentText: string) => Promise<Outline | null>;

                                                                    Type Aliases

                                                                    type AutocompleteSuggestionOptions

                                                                    type AutocompleteSuggestionOptions = {
                                                                    fillLeafsOnComplete?: boolean;
                                                                    schema?: GraphQLSchema;
                                                                    };

                                                                      type DefinitionQueryResult

                                                                      type DefinitionQueryResult = {
                                                                      queryRange: Range[];
                                                                      definitions: Definition[];
                                                                      };

                                                                        type HoverConfig

                                                                        type HoverConfig = {
                                                                        useMarkdown?: boolean;
                                                                        };

                                                                          type Severity

                                                                          type Severity = typeof SEVERITY;

                                                                            type SeverityEnum

                                                                            type SeverityEnum = keyof Severity;

                                                                              Package Files (8)

                                                                              Dependencies (5)

                                                                              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-interface.

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