graphql/language/ast
Classes
Location
Contains a range of UTF-8 character offsets and token references that identify the region of the source from which the AST derived.
Constructor
Creates a Location instance.
Signature:
new Location(startToken: Token, endToken: Token, source: Source)
Arguments
| Name | Type | Description |
|---|---|---|
| startToken | Token | The start token. |
| endToken | Token | The end token. |
| source | Source | Source document used to derive error locations. |
Returns
| Type | Description |
|---|---|
Location |
Members
| Name | Type | Description |
|---|---|---|
| start | number | The character offset at which this Node begins. |
| end | number | The character offset at which this Node ends. |
| startToken | Token | The Token at which this Node begins. |
| endToken | Token | The Token at which this Node ends. |
| source | Source | The Source document the AST represents. |
toJSON()
Returns a JSON representation of this location.
Signature:
toJSON(): { start: number; end: number }
Returns
| Type | Description |
|---|---|
{ start: number; end: number } | The JSON-serializable representation. |
Example
import { parse } from 'graphql/language';
const document = parse('{ hello }');
const location = document.loc?.toJSON();
// location: { start: 0, end: 9 }Token
Represents a range of characters represented by a lexical token within a Source.
Constructor
Creates a Token instance.
Signature:
new Token(kind: TokenKind, start: number, end: number, line: number, column: number, value?: string)
Arguments
| Name | Type | Description |
|---|---|---|
| kind | TokenKind | Token kind produced by lexical analysis. |
| start | number | Character offset where this token begins. |
| end | number | Character offset where this token ends. |
| line | number | One-indexed line number where this token begins. |
| column | number | One-indexed column number where this token begins. |
| value? | string | Interpreted value for non-punctuation tokens. |
Returns
| Type | Description |
|---|---|
Token |
Members
| Name | Type | Description |
|---|---|---|
| kind | TokenKind | The kind of Token. |
| start | number | The character offset at which this Node begins. |
| end | number | The character offset at which this Node ends. |
| line | number | The 1-indexed line number on which this Token appears. |
| column | number | The 1-indexed column number at which this Token begins. |
| value | string | For non-punctuation tokens, represents the interpreted value of the token. Note: is undefined for punctuation tokens, but typed as string for convenience in the parser. |
| prev | Token | null | Tokens exist as nodes in a double-linked-list amongst all tokens including ignored tokens. <SOF> is always the first node and <EOF> the last. |
| next | Token | null | Next token in the token stream, including ignored tokens. |
toJSON()
Returns a JSON representation of this token.
Signature:
toJSON(): { kind: TokenKind; value?: string; line: number; column: number }
Returns
| Type | Description |
|---|---|
{ kind: TokenKind; value?: string; line: number; column: number } | The JSON-serializable representation. |
Example
import { Lexer, Source } from 'graphql/language';
const lexer = new Lexer(new Source('{ hello }'));
const token = lexer.advance().toJSON();
// token: { kind: '{', value: undefined, line: 1, column: 1 }Types
ASTNode
Type alias. The list of all possible AST node types.
type ASTNode = NameNode | DocumentNode | OperationDefinitionNode | VariableDefinitionNode | VariableNode | SelectionSetNode | FieldNode | ArgumentNode | FragmentSpreadNode | InlineFragmentNode | FragmentDefinitionNode | IntValueNode | FloatValueNode | StringValueNode | BooleanValueNode | NullValueNode | EnumValueNode | ListValueNode | ObjectValueNode | ObjectFieldNode | DirectiveNode | NamedTypeNode | ListTypeNode | NonNullTypeNode | SchemaDefinitionNode | OperationTypeDefinitionNode | ScalarTypeDefinitionNode | ObjectTypeDefinitionNode | FieldDefinitionNode | InputValueDefinitionNode | InterfaceTypeDefinitionNode | UnionTypeDefinitionNode | EnumTypeDefinitionNode | EnumValueDefinitionNode | InputObjectTypeDefinitionNode | DirectiveDefinitionNode | SchemaExtensionNode | ScalarTypeExtensionNode | ObjectTypeExtensionNode | InterfaceTypeExtensionNode | UnionTypeExtensionNode | EnumTypeExtensionNode | InputObjectTypeExtensionNode | DirectiveExtensionNode | TypeCoordinateNode | MemberCoordinateNode | ArgumentCoordinateNode | DirectiveCoordinateNode | DirectiveArgumentCoordinateNode;
ASTKindToNode
Type alias. Utility type listing all nodes indexed by their kind.
type ASTKindToNode = mapped object;
NameNode
Interface. An identifier in a GraphQL document.
Members
| Name | Type | Description |
|---|---|---|
| kind | NAME | The discriminator identifying the concrete AST or introspection kind. |
| loc? | Location | The source location for this AST node, if location tracking was enabled. |
| value | string | The parsed value represented by this node. |
DocumentNode
Interface. The root AST node for a parsed GraphQL document.
Members
| Name | Type | Description |
|---|---|---|
| kind | DOCUMENT | The discriminator identifying the concrete AST or introspection kind. |
| loc? | Location | The source location for this AST node, if location tracking was enabled. |
| definitions | readonly DefinitionNode[] | Top-level executable and type-system definitions in this document. |
| tokenCount? | number | The number of lexical tokens parsed for this document, if token counting was enabled. |
DefinitionNode
Type alias. Any top-level definition that may appear in a GraphQL document.
type DefinitionNode = ExecutableDefinitionNode | TypeSystemDefinitionNode | TypeSystemExtensionNode;
ExecutableDefinitionNode
Type alias. Any executable definition that may appear in an operation document.
type ExecutableDefinitionNode = OperationDefinitionNode | FragmentDefinitionNode;
OperationDefinitionNode
Interface. A query, mutation, or subscription operation definition.
Members
| Name | Type | Description |
|---|---|---|
| kind | OPERATION_DEFINITION | The discriminator identifying the concrete AST or introspection kind. |
| description? | StringValueNode | The optional GraphQL description associated with this definition. |
| loc? | Location | The source location for this AST node, if location tracking was enabled. |
| operation | OperationTypeNode | The operation selected for execution. |
| name? | NameNode | Name node identifying this AST node. |
| variableDefinitions? | readonly VariableDefinitionNode[] | Variable definitions declared by this operation or fragment. |
| directives? | readonly DirectiveNode[] | Directives available in this schema or applied to this AST node. |
| selectionSet | SelectionSetNode | Selections made by this operation, field, or fragment. |
VariableDefinitionNode
Interface. A variable declaration in an operation or legacy fragment definition.
Members
| Name | Type | Description |
|---|---|---|
| kind | VARIABLE_DEFINITION | The discriminator identifying the concrete AST or introspection kind. |
| description? | StringValueNode | The optional GraphQL description associated with this definition. |
| loc? | Location | The source location for this AST node, if location tracking was enabled. |
| variable | VariableNode | The variable being defined or referenced. |
| type | TypeNode | The GraphQL type reference or runtime type for this element. |
| defaultValue? | ConstValueNode | The default value used when no explicit value is supplied. |
| directives? | readonly ConstDirectiveNode[] | Directives available in this schema or applied to this AST node. |
VariableNode
Interface. A variable reference, such as $id.
Members
| Name | Type | Description |
|---|---|---|
| kind | VARIABLE | The discriminator identifying the concrete AST or introspection kind. |
| loc? | Location | The source location for this AST node, if location tracking was enabled. |
| name | NameNode | Name node identifying this AST node. |
SelectionSetNode
Interface. A set of fields and fragments selected from an object, interface, or union.
Members
| Name | Type | Description |
|---|---|---|
| kind | SELECTION_SET | The discriminator identifying the concrete AST or introspection kind. |
| loc? | Location | The source location for this AST node, if location tracking was enabled. |
| selections | readonly SelectionNode[] | Fields and fragments contained in this selection set. |
SelectionNode
Type alias. Any selection that may appear inside a selection set.
type SelectionNode = FieldNode | FragmentSpreadNode | InlineFragmentNode;
FieldNode
Interface. A field selected in an executable GraphQL document.
Members
| Name | Type | Description |
|---|---|---|
| kind | FIELD | The discriminator identifying the concrete AST or introspection kind. |
| loc? | Location | The source location for this AST node, if location tracking was enabled. |
| alias? | NameNode | The response-key alias for this field, if one was supplied. |
| name | NameNode | Name node identifying this AST node. |
| arguments? | readonly ArgumentNode[] | Arguments supplied to this field, directive, or coordinate. |
| directives? | readonly DirectiveNode[] | Directives available in this schema or applied to this AST node. |
| selectionSet? | SelectionSetNode | Selections made by this operation, field, or fragment. |
ArgumentNode
Interface. An argument supplied to a field or directive.
Members
| Name | Type | Description |
|---|---|---|
| kind | ARGUMENT | The discriminator identifying the concrete AST or introspection kind. |
| loc? | Location | The source location for this AST node, if location tracking was enabled. |
| name | NameNode | Name node identifying this AST node. |
| value | ValueNode | The parsed value represented by this node. |
ConstArgumentNode
Interface. An argument node whose value is guaranteed to be constant.
Members
| Name | Type | Description |
|---|---|---|
| kind | ARGUMENT | The discriminator identifying the concrete AST or introspection kind. |
| loc? | Location | The source location for this AST node, if location tracking was enabled. |
| name | NameNode | Name node identifying this AST node. |
| value | ConstValueNode | The parsed value represented by this node. |
FragmentSpreadNode
Interface. A named fragment spread, such as ...userFields.
Members
| Name | Type | Description |
|---|---|---|
| kind | FRAGMENT_SPREAD | The discriminator identifying the concrete AST or introspection kind. |
| loc? | Location | The source location for this AST node, if location tracking was enabled. |
| name | NameNode | Name node identifying this AST node. |
| directives? | readonly DirectiveNode[] | Directives available in this schema or applied to this AST node. |
InlineFragmentNode
Interface. An inline fragment spread with an optional type condition.
Members
| Name | Type | Description |
|---|---|---|
| kind | INLINE_FRAGMENT | The discriminator identifying the concrete AST or introspection kind. |
| loc? | Location | The source location for this AST node, if location tracking was enabled. |
| typeCondition? | NamedTypeNode | The type condition that limits where this fragment applies. |
| directives? | readonly DirectiveNode[] | Directives available in this schema or applied to this AST node. |
| selectionSet | SelectionSetNode | Selections made by this operation, field, or fragment. |
FragmentDefinitionNode
Interface. A reusable fragment definition declared in an executable document.
Members
| Name | Type | Description |
|---|---|---|
| kind | FRAGMENT_DEFINITION | The discriminator identifying the concrete AST or introspection kind. |
| description? | StringValueNode | The optional GraphQL description associated with this definition. |
| loc? | Location | The source location for this AST node, if location tracking was enabled. |
| name | NameNode | Name node identifying this AST node. |
| variableDefinitions? | readonly VariableDefinitionNode[] | |
| typeCondition | NamedTypeNode | The type condition that limits where this fragment applies. |
| directives? | readonly DirectiveNode[] | Directives available in this schema or applied to this AST node. |
| selectionSet | SelectionSetNode | Selections made by this operation, field, or fragment. |
ValueNode
Type alias. Any value literal that may appear in an executable GraphQL document.
type ValueNode = VariableNode | IntValueNode | FloatValueNode | StringValueNode | BooleanValueNode | NullValueNode | EnumValueNode | ListValueNode | ObjectValueNode;
ConstValueNode
Type alias. Any value literal that is guaranteed not to contain a variable reference.
type ConstValueNode = IntValueNode | FloatValueNode | StringValueNode | BooleanValueNode | NullValueNode | EnumValueNode | ConstListValueNode | ConstObjectValueNode;
IntValueNode
Interface. An integer value literal.
Members
| Name | Type | Description |
|---|---|---|
| kind | INT | The discriminator identifying the concrete AST or introspection kind. |
| loc? | Location | The source location for this AST node, if location tracking was enabled. |
| value | string | The parsed value represented by this node. |
FloatValueNode
Interface. A floating-point value literal.
Members
| Name | Type | Description |
|---|---|---|
| kind | FLOAT | The discriminator identifying the concrete AST or introspection kind. |
| loc? | Location | The source location for this AST node, if location tracking was enabled. |
| value | string | The parsed value represented by this node. |
StringValueNode
Interface. A string value literal.
Members
| Name | Type | Description |
|---|---|---|
| kind | STRING | The discriminator identifying the concrete AST or introspection kind. |
| loc? | Location | The source location for this AST node, if location tracking was enabled. |
| value | string | The parsed value represented by this node. |
| block? | boolean | Whether this string was parsed from block string syntax. |
BooleanValueNode
Interface. A boolean value literal.
Members
| Name | Type | Description |
|---|---|---|
| kind | BOOLEAN | The discriminator identifying the concrete AST or introspection kind. |
| loc? | Location | The source location for this AST node, if location tracking was enabled. |
| value | boolean | The parsed value represented by this node. |
NullValueNode
Interface. A null value literal.
Members
| Name | Type | Description |
|---|---|---|
| kind | NULL | The discriminator identifying the concrete AST or introspection kind. |
| loc? | Location | The source location for this AST node, if location tracking was enabled. |
EnumValueNode
Interface. An enum value literal.
Members
| Name | Type | Description |
|---|---|---|
| kind | ENUM | The discriminator identifying the concrete AST or introspection kind. |
| loc? | Location | The source location for this AST node, if location tracking was enabled. |
| value | string | The parsed value represented by this node. |
ListValueNode
Interface. A list value literal.
Members
| Name | Type | Description |
|---|---|---|
| kind | LIST | The discriminator identifying the concrete AST or introspection kind. |
| loc? | Location | The source location for this AST node, if location tracking was enabled. |
| values | readonly ValueNode[] | Values contained in this enum, list, or input-object definition. |
ConstListValueNode
Interface. A list value literal whose elements are all constant values.
Members
| Name | Type | Description |
|---|---|---|
| kind | LIST | The discriminator identifying the concrete AST or introspection kind. |
| loc? | Location | The source location for this AST node, if location tracking was enabled. |
| values | readonly ConstValueNode[] | Values contained in this enum, list, or input-object definition. |
ObjectValueNode
Interface. An input object value literal.
Members
| Name | Type | Description |
|---|---|---|
| kind | OBJECT | The discriminator identifying the concrete AST or introspection kind. |
| loc? | Location | The source location for this AST node, if location tracking was enabled. |
| fields | readonly ObjectFieldNode[] | Fields declared by this object, interface, input object, or literal. |
ConstObjectValueNode
Interface. An input object value literal whose fields are all constant values.
Members
| Name | Type | Description |
|---|---|---|
| kind | OBJECT | The discriminator identifying the concrete AST or introspection kind. |
| loc? | Location | The source location for this AST node, if location tracking was enabled. |
| fields | readonly ConstObjectFieldNode[] | Fields declared by this object, interface, input object, or literal. |
ObjectFieldNode
Interface. A field inside an input object value literal.
Members
| Name | Type | Description |
|---|---|---|
| kind | OBJECT_FIELD | The discriminator identifying the concrete AST or introspection kind. |
| loc? | Location | The source location for this AST node, if location tracking was enabled. |
| name | NameNode | Name node identifying this AST node. |
| value | ValueNode | The parsed value represented by this node. |
ConstObjectFieldNode
Interface. A field inside a constant input object value literal.
Members
| Name | Type | Description |
|---|---|---|
| kind | OBJECT_FIELD | The discriminator identifying the concrete AST or introspection kind. |
| loc? | Location | The source location for this AST node, if location tracking was enabled. |
| name | NameNode | Name node identifying this AST node. |
| value | ConstValueNode | The parsed value represented by this node. |
DirectiveNode
Interface. A directive applied to an executable or type-system location.
Members
| Name | Type | Description |
|---|---|---|
| kind | DIRECTIVE | The discriminator identifying the concrete AST or introspection kind. |
| loc? | Location | The source location for this AST node, if location tracking was enabled. |
| name | NameNode | Name node identifying this AST node. |
| arguments? | readonly ArgumentNode[] | Arguments supplied to this field, directive, or coordinate. |
ConstDirectiveNode
Interface. A directive whose arguments are all constant values.
Members
| Name | Type | Description |
|---|---|---|
| kind | DIRECTIVE | The discriminator identifying the concrete AST or introspection kind. |
| loc? | Location | The source location for this AST node, if location tracking was enabled. |
| name | NameNode | Name node identifying this AST node. |
| arguments? | readonly ConstArgumentNode[] | Arguments supplied to this field, directive, or coordinate. |
TypeNode
Type alias. Any GraphQL type reference AST node.
type TypeNode = NamedTypeNode | ListTypeNode | NonNullTypeNode;
NamedTypeNode
Interface. A named type reference.
Members
| Name | Type | Description |
|---|---|---|
| kind | NAMED_TYPE | The discriminator identifying the concrete AST or introspection kind. |
| loc? | Location | The source location for this AST node, if location tracking was enabled. |
| name | NameNode | Name node identifying this AST node. |
ListTypeNode
Interface. A list type reference.
Members
| Name | Type | Description |
|---|---|---|
| kind | LIST_TYPE | The discriminator identifying the concrete AST or introspection kind. |
| loc? | Location | The source location for this AST node, if location tracking was enabled. |
| type | TypeNode | The GraphQL type reference or runtime type for this element. |
NonNullTypeNode
Interface. A non-null type reference.
Members
| Name | Type | Description |
|---|---|---|
| kind | NON_NULL_TYPE | The discriminator identifying the concrete AST or introspection kind. |
| loc? | Location | The source location for this AST node, if location tracking was enabled. |
| type | NamedTypeNode | ListTypeNode | The GraphQL type reference or runtime type for this element. |
TypeSystemDefinitionNode
Type alias. Any type-system definition that may appear in a schema document.
type TypeSystemDefinitionNode = SchemaDefinitionNode | TypeDefinitionNode | DirectiveDefinitionNode;
SchemaDefinitionNode
Interface. A schema definition in a type-system document.
Members
| Name | Type | Description |
|---|---|---|
| kind | SCHEMA_DEFINITION | The discriminator identifying the concrete AST or introspection kind. |
| loc? | Location | The source location for this AST node, if location tracking was enabled. |
| description? | StringValueNode | The optional GraphQL description associated with this definition. |
| directives? | readonly ConstDirectiveNode[] | Directives available in this schema or applied to this AST node. |
| operationTypes | readonly OperationTypeDefinitionNode[] | Root operation types declared by this schema definition or extension. |
OperationTypeDefinitionNode
Interface. A root operation type declaration inside a schema definition or extension.
Members
| Name | Type | Description |
|---|---|---|
| kind | OPERATION_TYPE_DEFINITION | The discriminator identifying the concrete AST or introspection kind. |
| loc? | Location | The source location for this AST node, if location tracking was enabled. |
| operation | OperationTypeNode | The operation selected for execution. |
| type | NamedTypeNode | The GraphQL type reference or runtime type for this element. |
TypeDefinitionNode
Type alias. Any named type definition that may appear in a schema document.
type TypeDefinitionNode = ScalarTypeDefinitionNode | ObjectTypeDefinitionNode | InterfaceTypeDefinitionNode | UnionTypeDefinitionNode | EnumTypeDefinitionNode | InputObjectTypeDefinitionNode;
ScalarTypeDefinitionNode
Interface. A scalar type definition in a type-system document.
Members
| Name | Type | Description |
|---|---|---|
| kind | SCALAR_TYPE_DEFINITION | The discriminator identifying the concrete AST or introspection kind. |
| loc? | Location | The source location for this AST node, if location tracking was enabled. |
| description? | StringValueNode | The optional GraphQL description associated with this definition. |
| name | NameNode | Name node identifying this AST node. |
| directives? | readonly ConstDirectiveNode[] | Directives available in this schema or applied to this AST node. |
ObjectTypeDefinitionNode
Interface. An object type definition in a type-system document.
Members
| Name | Type | Description |
|---|---|---|
| kind | OBJECT_TYPE_DEFINITION | The discriminator identifying the concrete AST or introspection kind. |
| loc? | Location | The source location for this AST node, if location tracking was enabled. |
| description? | StringValueNode | The optional GraphQL description associated with this definition. |
| name | NameNode | Name node identifying this AST node. |
| interfaces? | readonly NamedTypeNode[] | Interfaces implemented by this object or interface type. |
| directives? | readonly ConstDirectiveNode[] | Directives available in this schema or applied to this AST node. |
| fields? | readonly FieldDefinitionNode[] | Fields declared by this object, interface, input object, or literal. |
FieldDefinitionNode
Interface. A field definition declared by an object or interface type.
Members
| Name | Type | Description |
|---|---|---|
| kind | FIELD_DEFINITION | The discriminator identifying the concrete AST or introspection kind. |
| loc? | Location | The source location for this AST node, if location tracking was enabled. |
| description? | StringValueNode | The optional GraphQL description associated with this definition. |
| name | NameNode | Name node identifying this AST node. |
| arguments? | readonly InputValueDefinitionNode[] | Arguments supplied to this field, directive, or coordinate. |
| type | TypeNode | The GraphQL type reference or runtime type for this element. |
| directives? | readonly ConstDirectiveNode[] | Directives available in this schema or applied to this AST node. |
InputValueDefinitionNode
Interface. An argument or input-field definition.
Members
| Name | Type | Description |
|---|---|---|
| kind | INPUT_VALUE_DEFINITION | The discriminator identifying the concrete AST or introspection kind. |
| loc? | Location | The source location for this AST node, if location tracking was enabled. |
| description? | StringValueNode | The optional GraphQL description associated with this definition. |
| name | NameNode | Name node identifying this AST node. |
| type | TypeNode | The GraphQL type reference or runtime type for this element. |
| defaultValue? | ConstValueNode | The default value used when no explicit value is supplied. |
| directives? | readonly ConstDirectiveNode[] | Directives available in this schema or applied to this AST node. |
InterfaceTypeDefinitionNode
Interface. An interface type definition in a type-system document.
Members
| Name | Type | Description |
|---|---|---|
| kind | INTERFACE_TYPE_DEFINITION | The discriminator identifying the concrete AST or introspection kind. |
| loc? | Location | The source location for this AST node, if location tracking was enabled. |
| description? | StringValueNode | The optional GraphQL description associated with this definition. |
| name | NameNode | Name node identifying this AST node. |
| interfaces? | readonly NamedTypeNode[] | Interfaces implemented by this object or interface type. |
| directives? | readonly ConstDirectiveNode[] | Directives available in this schema or applied to this AST node. |
| fields? | readonly FieldDefinitionNode[] | Fields declared by this object, interface, input object, or literal. |
UnionTypeDefinitionNode
Interface. A union type definition in a type-system document.
Members
| Name | Type | Description |
|---|---|---|
| kind | UNION_TYPE_DEFINITION | The discriminator identifying the concrete AST or introspection kind. |
| loc? | Location | The source location for this AST node, if location tracking was enabled. |
| description? | StringValueNode | The optional GraphQL description associated with this definition. |
| name | NameNode | Name node identifying this AST node. |
| directives? | readonly ConstDirectiveNode[] | Directives available in this schema or applied to this AST node. |
| types? | readonly NamedTypeNode[] | Object types that belong to this union type. |
EnumTypeDefinitionNode
Interface. An enum type definition in a type-system document.
Members
| Name | Type | Description |
|---|---|---|
| kind | ENUM_TYPE_DEFINITION | The discriminator identifying the concrete AST or introspection kind. |
| loc? | Location | The source location for this AST node, if location tracking was enabled. |
| description? | StringValueNode | The optional GraphQL description associated with this definition. |
| name | NameNode | Name node identifying this AST node. |
| directives? | readonly ConstDirectiveNode[] | Directives available in this schema or applied to this AST node. |
| values? | readonly EnumValueDefinitionNode[] | Values contained in this enum, list, or input-object definition. |
EnumValueDefinitionNode
Interface. An enum value definition.
Members
| Name | Type | Description |
|---|---|---|
| kind | ENUM_VALUE_DEFINITION | The discriminator identifying the concrete AST or introspection kind. |
| loc? | Location | The source location for this AST node, if location tracking was enabled. |
| description? | StringValueNode | The optional GraphQL description associated with this definition. |
| name | NameNode | Name node identifying this AST node. |
| directives? | readonly ConstDirectiveNode[] | Directives available in this schema or applied to this AST node. |
InputObjectTypeDefinitionNode
Interface. An input object type definition in a type-system document.
Members
| Name | Type | Description |
|---|---|---|
| kind | INPUT_OBJECT_TYPE_DEFINITION | The discriminator identifying the concrete AST or introspection kind. |
| loc? | Location | The source location for this AST node, if location tracking was enabled. |
| description? | StringValueNode | The optional GraphQL description associated with this definition. |
| name | NameNode | Name node identifying this AST node. |
| directives? | readonly ConstDirectiveNode[] | Directives available in this schema or applied to this AST node. |
| fields? | readonly InputValueDefinitionNode[] | Fields declared by this object, interface, input object, or literal. |
DirectiveDefinitionNode
Interface. A directive definition in a type-system document.
Members
| Name | Type | Description |
|---|---|---|
| kind | DIRECTIVE_DEFINITION | The discriminator identifying the concrete AST or introspection kind. |
| loc? | Location | The source location for this AST node, if location tracking was enabled. |
| description? | StringValueNode | The optional GraphQL description associated with this definition. |
| name | NameNode | Name node identifying this AST node. |
| arguments? | readonly InputValueDefinitionNode[] | Arguments supplied to this field, directive, or coordinate. |
| directives? | readonly ConstDirectiveNode[] | Directives available in this schema or applied to this AST node. |
| repeatable | boolean | Whether this directive may appear more than once at the same location. |
| locations | readonly NameNode[] | Locations where this directive may be applied. |
TypeSystemExtensionNode
Type alias. Any type-system extension that may appear in a schema extension document.
type TypeSystemExtensionNode = SchemaExtensionNode | TypeExtensionNode | DirectiveExtensionNode;
SchemaExtensionNode
Interface. A schema extension in a type-system document.
Members
| Name | Type | Description |
|---|---|---|
| kind | SCHEMA_EXTENSION | The discriminator identifying the concrete AST or introspection kind. |
| loc? | Location | The source location for this AST node, if location tracking was enabled. |
| directives? | readonly ConstDirectiveNode[] | Directives available in this schema or applied to this AST node. |
| operationTypes? | readonly OperationTypeDefinitionNode[] | Root operation types declared by this schema definition or extension. |
TypeExtensionNode
Type alias. Any named type extension that may appear in a schema extension document.
type TypeExtensionNode = ScalarTypeExtensionNode | ObjectTypeExtensionNode | InterfaceTypeExtensionNode | UnionTypeExtensionNode | EnumTypeExtensionNode | InputObjectTypeExtensionNode;
ScalarTypeExtensionNode
Interface. A scalar type extension.
Members
| Name | Type | Description |
|---|---|---|
| kind | SCALAR_TYPE_EXTENSION | The discriminator identifying the concrete AST or introspection kind. |
| loc? | Location | The source location for this AST node, if location tracking was enabled. |
| name | NameNode | Name node identifying this AST node. |
| directives? | readonly ConstDirectiveNode[] | Directives available in this schema or applied to this AST node. |
ObjectTypeExtensionNode
Interface. An object type extension.
Members
| Name | Type | Description |
|---|---|---|
| kind | OBJECT_TYPE_EXTENSION | The discriminator identifying the concrete AST or introspection kind. |
| loc? | Location | The source location for this AST node, if location tracking was enabled. |
| name | NameNode | Name node identifying this AST node. |
| interfaces? | readonly NamedTypeNode[] | Interfaces implemented by this object or interface type. |
| directives? | readonly ConstDirectiveNode[] | Directives available in this schema or applied to this AST node. |
| fields? | readonly FieldDefinitionNode[] | Fields declared by this object, interface, input object, or literal. |
InterfaceTypeExtensionNode
Interface. An interface type extension.
Members
| Name | Type | Description |
|---|---|---|
| kind | INTERFACE_TYPE_EXTENSION | The discriminator identifying the concrete AST or introspection kind. |
| loc? | Location | The source location for this AST node, if location tracking was enabled. |
| name | NameNode | Name node identifying this AST node. |
| interfaces? | readonly NamedTypeNode[] | Interfaces implemented by this object or interface type. |
| directives? | readonly ConstDirectiveNode[] | Directives available in this schema or applied to this AST node. |
| fields? | readonly FieldDefinitionNode[] | Fields declared by this object, interface, input object, or literal. |
UnionTypeExtensionNode
Interface. A union type extension.
Members
| Name | Type | Description |
|---|---|---|
| kind | UNION_TYPE_EXTENSION | The discriminator identifying the concrete AST or introspection kind. |
| loc? | Location | The source location for this AST node, if location tracking was enabled. |
| name | NameNode | Name node identifying this AST node. |
| directives? | readonly ConstDirectiveNode[] | Directives available in this schema or applied to this AST node. |
| types? | readonly NamedTypeNode[] | Object types that belong to this union type. |
EnumTypeExtensionNode
Interface. An enum type extension.
Members
| Name | Type | Description |
|---|---|---|
| kind | ENUM_TYPE_EXTENSION | The discriminator identifying the concrete AST or introspection kind. |
| loc? | Location | The source location for this AST node, if location tracking was enabled. |
| name | NameNode | Name node identifying this AST node. |
| directives? | readonly ConstDirectiveNode[] | Directives available in this schema or applied to this AST node. |
| values? | readonly EnumValueDefinitionNode[] | Values contained in this enum, list, or input-object definition. |
InputObjectTypeExtensionNode
Interface. An input object type extension.
Members
| Name | Type | Description |
|---|---|---|
| kind | INPUT_OBJECT_TYPE_EXTENSION | The discriminator identifying the concrete AST or introspection kind. |
| loc? | Location | The source location for this AST node, if location tracking was enabled. |
| name | NameNode | Name node identifying this AST node. |
| directives? | readonly ConstDirectiveNode[] | Directives available in this schema or applied to this AST node. |
| fields? | readonly InputValueDefinitionNode[] | Fields declared by this object, interface, input object, or literal. |
DirectiveExtensionNode
Interface. A directive extension.
Members
| Name | Type | Description |
|---|---|---|
| kind | DIRECTIVE_EXTENSION | The discriminator identifying the concrete AST or introspection kind. |
| loc? | Location | The source location for this AST node, if location tracking was enabled. |
| name | NameNode | Name node identifying this AST node. |
| directives? | readonly ConstDirectiveNode[] | Directives available in this schema or applied to this AST node. |
SchemaCoordinateNode
Type alias. Any AST node representing a GraphQL schema coordinate.
type SchemaCoordinateNode = TypeCoordinateNode | MemberCoordinateNode | ArgumentCoordinateNode | DirectiveCoordinateNode | DirectiveArgumentCoordinateNode;
TypeCoordinateNode
Interface. A schema coordinate that refers to a named type.
Members
| Name | Type | Description |
|---|---|---|
| kind | TYPE_COORDINATE | The discriminator identifying the concrete AST or introspection kind. |
| loc? | Location | The source location for this AST node, if location tracking was enabled. |
| name | NameNode | Name node identifying this AST node. |
MemberCoordinateNode
Interface. A schema coordinate that refers to a member of a named type.
Members
| Name | Type | Description |
|---|---|---|
| kind | MEMBER_COORDINATE | The discriminator identifying the concrete AST or introspection kind. |
| loc? | Location | The source location for this AST node, if location tracking was enabled. |
| name | NameNode | Name node identifying this AST node. |
| memberName | NameNode | The member name referenced by this schema coordinate. |
ArgumentCoordinateNode
Interface. A schema coordinate that refers to a field or directive argument.
Members
| Name | Type | Description |
|---|---|---|
| kind | ARGUMENT_COORDINATE | The discriminator identifying the concrete AST or introspection kind. |
| loc? | Location | The source location for this AST node, if location tracking was enabled. |
| name | NameNode | Name node identifying this AST node. |
| fieldName | NameNode | The field name referenced by this schema coordinate. |
| argumentName | NameNode | The argument name referenced by this schema coordinate. |
DirectiveCoordinateNode
Interface. A schema coordinate that refers to a directive.
Members
| Name | Type | Description |
|---|---|---|
| kind | DIRECTIVE_COORDINATE | The discriminator identifying the concrete AST or introspection kind. |
| loc? | Location | The source location for this AST node, if location tracking was enabled. |
| name | NameNode | Name node identifying this AST node. |
DirectiveArgumentCoordinateNode
Interface. A schema coordinate that refers to a directive argument.
Members
| Name | Type | Description |
|---|---|---|
| kind | DIRECTIVE_ARGUMENT_COORDINATE | The discriminator identifying the concrete AST or introspection kind. |
| loc? | Location | The source location for this AST node, if location tracking was enabled. |
| name | NameNode | Name node identifying this AST node. |
| argumentName | NameNode | The argument name referenced by this schema coordinate. |