Const AdditionalRuleKinds
AdditionalRuleKinds: object
ALIASED_FIELD
ALIASED_FIELD: "AliasedField" = "AliasedField"
ARGUMENTS
ARGUMENTS: "Arguments" = "Arguments"
ARGUMENTS_DEF
ARGUMENTS_DEF: "ArgumentsDef" = "ArgumentsDef"
COMMENT
COMMENT: "Comment" = "Comment"
DIRECTIVE_DEF
DIRECTIVE_DEF: "DirectiveDef" = "DirectiveDef"
ENUM_DEF
ENUM_DEF: "EnumDef" = "EnumDef"
ENUM_VALUE
ENUM_VALUE: "EnumValue" = "EnumValue"
EXTEND_DEF
EXTEND_DEF: "ExtendDef" = "ExtendDef"
EXTENSION_DEFINITION
EXTENSION_DEFINITION: "ExtensionDefinition" = "ExtensionDefinition"
FIELD_DEF
FIELD_DEF: "FieldDef" = "FieldDef"
IMPLEMENTS
IMPLEMENTS: "Implements" = "Implements"
INPUT_DEF
INPUT_DEF: "InputDef" = "InputDef"
INPUT_VALUE_DEF
INPUT_VALUE_DEF: "InputValueDef" = "InputValueDef"
INTERFACE_DEF
INTERFACE_DEF: "InterfaceDef" = "InterfaceDef"
INVALID
INVALID: "Invalid" = "Invalid"
LIST_VALUE
LIST_VALUE: "ListValue" = "ListValue"
MUTATION
MUTATION: "Mutation" = "Mutation"
OBJECT_TYPE_DEF
OBJECT_TYPE_DEF: "ObjectTypeDef" = "ObjectTypeDef"
OBJECT_VALUE
OBJECT_VALUE: "ObjectValue" = "ObjectValue"
QUERY
QUERY: "Query" = "Query"
SCALAR_DEF
SCALAR_DEF: "ScalarDef" = "ScalarDef"
SCHEMA_DEF
SCHEMA_DEF: "SchemaDef" = "SchemaDef"
SHORT_QUERY
SHORT_QUERY: "ShortQuery" = "ShortQuery"
SUBSCRIPTION
SUBSCRIPTION: "Subscription" = "Subscription"
TYPE
TYPE: "Type" = "Type"
TYPE_CONDITION
TYPE_CONDITION: "TypeCondition" = "TypeCondition"
UNION_DEF
UNION_DEF: "UnionDef" = "UnionDef"
VARIABLE_DEFINITIONS
VARIABLE_DEFINITIONS: "VariableDefinitions" = "VariableDefinitions"
Const ParseRules
ParseRules: object
AliasedField
Aliased
Field: Rule[] = [name('property'),p(':'),name('qualifier'),opt('Arguments'),list('Directive'),opt('SelectionSet'),]
Argument
Argument
: (string | Rule)[] = [name('attribute'), p(':'), 'Value']
Arguments
Arguments
: Rule[] = [p('('), list('Argument'), p(')')]
ArgumentsDef
Arguments
Def: Rule[] = [p('('), list('InputValueDef'), p(')')]
BooleanValue
BooleanValue: { style: string; match: any }[] = [t('Name', 'builtin')]
DefaultValue
Default
Value: (string | Rule)[] = [p('='), 'Value']
Directive
Directive
: Rule[] = [p('@', 'meta'), name('meta'), opt('Arguments')]
DirectiveDef
Directive
Def: (Rule | { style: string; match: any })[] = [word('directive'),p('@', 'meta'),name('meta'),opt('ArgumentsDef'),word('on'),list('DirectiveLocation', p('|')),]
DirectiveLocation
Directive
Location: Rule[] = [name('string-2')]
Document
Document
: Rule[] = [list('Definition')]
EnumDef
Enum
Def: (Rule | { style: string; match: any })[] = [word('enum'),name('atom'),list('Directive'),p('{'),list('EnumValueDef'),p('}'),]
EnumValue
Enum
Value: Rule[] = [name('string-2')]
EnumValueDef
Enum
ValueDef: Rule[] = [name('string-2'), list('Directive')]
ExtendDef
ExtendDef: (string | { style: string; match: any })[] = [word('extend'), 'ExtensionDefinition']
Field
Field
: Rule[] = [name('property'),opt('Arguments'),list('Directive'),opt('SelectionSet'),]
FieldDef
Field
Def: (string | Rule)[] = [name('property'),opt('ArgumentsDef'),p(':'),'Type',list('Directive'),]
FragmentDefinition
Fragment
Definition: (string | Rule | { style: string; match: any })[] = [word('fragment'),opt(butNot(name('def'), [word('on')])),'TypeCondition',list('Directive'),'SelectionSet',]
FragmentSpread
Fragment
Spread: Rule[] = [p('...'), name('def'), list('Directive')]
Implements
Implements
: (Rule | { style
: string; match
: any })[] = [word('implements'), list('NamedType', p('&'))]
InlineFragment
Inline
Fragment: (string | Rule)[] = [p('...'),opt('TypeCondition'),list('Directive'),'SelectionSet',]
InputDef
Input
Def: (Rule | { style: string; match: any })[] = [word('input'),name('atom'),list('Directive'),p('{'),list('InputValueDef'),p('}'),]
InputValueDef
Input
ValueDef: (string | Rule)[] = [name('attribute'),p(':'),'Type',opt('DefaultValue'),list('Directive'),]
InterfaceDef
Interface
Def: (Rule | { style: string; match: any })[] = [word('interface'),name('atom'),opt('Implements'),list('Directive'),p('{'),list('FieldDef'),p('}'),]
ListType
List
Type: (string | Rule)[] = [p('['), 'Type', p(']'), opt(p('!'))]
ListValue
List
Value: Rule[] = [p('['), list('Value'), p(']')]
Mutation
Mutation
: (string | Rule | { style
: string; match
: any })[] = [word('mutation'),opt(name('def')),opt('VariableDefinitions'),list('Directive'),'SelectionSet',]
NamedType
NamedType: { style: string; match: any; update: any }[] = [type('atom')]
NonNullType
Non
NullType: (string | Rule)[] = ['NamedType', opt(p('!'))]
NullValue
NullValue: { style: string; match: any }[] = [t('Name', 'keyword')]
NumberValue
NumberValue: { style: string; match: any }[] = [t('Number', 'number')]
ObjectField
Object
Field: (string | Rule)[] = [name('attribute'), p(':'), 'Value']
ObjectTypeDef
Object
TypeDef: (Rule | { style: string; match: any })[] = [word('type'),name('atom'),opt('Implements'),list('Directive'),p('{'),list('FieldDef'),p('}'),]
ObjectValue
Object
Value: Rule[] = [p('{'), list('ObjectField'), p('}')]
OperationTypeDef
Operation
TypeDef: Rule[] = [name('keyword'), p(':'), name('atom')]
Query
Query
: (string | Rule | { style
: string; match
: any })[] = [word('query'),opt(name('def')),opt('VariableDefinitions'),list('Directive'),'SelectionSet',]
ScalarDef
Scalar
Def: (Rule | { style: string; match: any })[] = [word('scalar'), name('atom'), list('Directive')]
SchemaDef
Schema
Def: (Rule | { style: string; match: any })[] = [word('schema'),list('Directive'),p('{'),list('OperationTypeDef'),p('}'),]
SelectionSet
Selection
Set: Rule[] = [p('{'), list('Selection'), p('}')]
ShortQuery
ShortQuery: string[] = ['SelectionSet']
StringValue
StringValue: { style: string; match: any; update: any }[] = [{style: 'string',match: (token: Token) => token.kind === 'String',update(state: State, token: Token) {if (token.value.startsWith('"""')) {state.inBlockstring = !token.value.slice(3).endsWith('"""');}},},]
Subscription
Subscription
: (string | Rule | { style
: string; match
: any })[] = [word('subscription'),opt(name('def')),opt('VariableDefinitions'),list('Directive'),'SelectionSet',]
TypeCondition
TypeCondition: (string | { style: string; match: any })[] = [word('on'), 'NamedType']
UnionDef
Union
Def: (Rule | { style: string; match: any })[] = [word('union'),name('atom'),list('Directive'),p('='),list('UnionMember', p('|')),]
UnionMember
UnionMember: string[] = ['NamedType']
Variable
Variable
: Rule[] = [p('$', 'variable'), name('variable')]
VariableDefinition
Variable
Definition: (string | Rule)[] = ['Variable', p(':'), 'Type', opt('DefaultValue')]
VariableDefinitions
Variable
Definitions: Rule[] = [p('('), list('VariableDefinition'), p(')')]
[Kind.ENUM_TYPE_EXTENSION]
[Kind.ENUM_TYPE_EXTENSION]: string[] = ['EnumDef']
[Kind.INPUT_OBJECT_TYPE_EXTENSION]
[Kind.INPUT_OBJECT_TYPE_EXTENSION]: string[] = ['InputDef']
[Kind.INTERFACE_TYPE_EXTENSION]
[Kind.INTERFACE_TYPE_EXTENSION]: string[] = ['InterfaceDef']
[Kind.OBJECT_TYPE_EXTENSION]
[Kind.OBJECT_TYPE_EXTENSION]: string[] = ['ObjectTypeDef']
[Kind.SCALAR_TYPE_EXTENSION]
[Kind.SCALAR_TYPE_EXTENSION]: string[] = ['ScalarDef']
[Kind.SCHEMA_EXTENSION]
[Kind.SCHEMA_EXTENSION]: string[] = ['SchemaDef']
[Kind.UNION_TYPE_EXTENSION]
[Kind.UNION_TYPE_EXTENSION]: string[] = ['UnionDef']
Selection
- Selection(token: Token, stream: CharacterStream): "Field" | "AliasedField" | "InlineFragment" | "FragmentSpread"
-
Parameters
Returns "Field" | "AliasedField" | "InlineFragment" | "FragmentSpread"
Type
- Type(token: Token): "ListType" | "NonNullType"
-
Parameters
Returns "ListType" | "NonNullType"
Value
- Value(token: Token): undefined | null | "EnumValue" | "ObjectValue" | "ListValue" | "Variable" | "NamedType" | "NumberValue" | "StringValue" | "BooleanValue" | "NullValue"
-
Parameters
Returns undefined | null | "EnumValue" | "ObjectValue" | "ListValue" | "Variable" | "NamedType" | "NumberValue" | "StringValue" | "BooleanValue" | "NullValue"
graphql-language-service
Changelog | API Docs | Discord
Purpose
This package brings together all the dependencies for building out web or desktop IDE services for the GraphQL Language.
It is named as such to match the convention of other vscode language services.
Interface
Language Service Protocol (LSP) methods written in TypeScript used by
graphql-language-service-server
,monaco-graphql
andcodemirror-graphql
.The goal is to provide methods for creating Language Server Protocol compliant services to be used by an IDE plugin, a browser application or desktop application.
Parser
A standalone online, immutable, dependency-free parser for GraphQL, used by the LSP interface methods
Utils
Various utilities