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
NameTypeDescription
startTokenTokenThe start token.
endTokenTokenThe end token.
sourceSourceSource document used to derive error locations.
Returns
TypeDescription
Location

Members

NameTypeDescription
startnumberThe character offset at which this Node begins.
endnumberThe character offset at which this Node ends.
startTokenTokenThe Token at which this Node begins.
endTokenTokenThe Token at which this Node ends.
sourceSourceThe Source document the AST represents.

toJSON()

Returns a JSON representation of this location.

Signature:

toJSON(): { start: number; end: number }
Returns
TypeDescription
{ 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
NameTypeDescription
kindTokenKindToken kind produced by lexical analysis.
startnumberCharacter offset where this token begins.
endnumberCharacter offset where this token ends.
linenumberOne-indexed line number where this token begins.
columnnumberOne-indexed column number where this token begins.
value?stringInterpreted value for non-punctuation tokens.
Returns
TypeDescription
Token

Members

NameTypeDescription
kindTokenKindThe kind of Token.
startnumberThe character offset at which this Node begins.
endnumberThe character offset at which this Node ends.
linenumberThe 1-indexed line number on which this Token appears.
columnnumberThe 1-indexed column number at which this Token begins.
valuestringFor 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.
prevToken | nullTokens exist as nodes in a double-linked-list amongst all tokens
including ignored tokens. <SOF> is always the first node and <EOF>
the last.
nextToken | nullNext 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
TypeDescription
{ 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

NameTypeDescription
kindNAMEThe discriminator identifying the concrete AST or introspection kind.
loc?LocationThe source location for this AST node, if location tracking was enabled.
valuestringThe parsed value represented by this node.

DocumentNode

Interface. The root AST node for a parsed GraphQL document.

Members

NameTypeDescription
kindDOCUMENTThe discriminator identifying the concrete AST or introspection kind.
loc?LocationThe source location for this AST node, if location tracking was enabled.
definitionsreadonly DefinitionNode[]Top-level executable and type-system definitions in this document.
tokenCount?numberThe 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

NameTypeDescription
kindOPERATION_DEFINITIONThe discriminator identifying the concrete AST or introspection kind.
description?StringValueNodeThe optional GraphQL description associated with this definition.
loc?LocationThe source location for this AST node, if location tracking was enabled.
operationOperationTypeNodeThe operation selected for execution.
name?NameNodeName 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.
selectionSetSelectionSetNodeSelections made by this operation, field, or fragment.

VariableDefinitionNode

Interface. A variable declaration in an operation or legacy fragment definition.

Members

NameTypeDescription
kindVARIABLE_DEFINITIONThe discriminator identifying the concrete AST or introspection kind.
description?StringValueNodeThe optional GraphQL description associated with this definition.
loc?LocationThe source location for this AST node, if location tracking was enabled.
variableVariableNodeThe variable being defined or referenced.
typeTypeNodeThe GraphQL type reference or runtime type for this element.
defaultValue?ConstValueNodeThe 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

NameTypeDescription
kindVARIABLEThe discriminator identifying the concrete AST or introspection kind.
loc?LocationThe source location for this AST node, if location tracking was enabled.
nameNameNodeName node identifying this AST node.

SelectionSetNode

Interface. A set of fields and fragments selected from an object, interface, or union.

Members

NameTypeDescription
kindSELECTION_SETThe discriminator identifying the concrete AST or introspection kind.
loc?LocationThe source location for this AST node, if location tracking was enabled.
selectionsreadonly 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

NameTypeDescription
kindFIELDThe discriminator identifying the concrete AST or introspection kind.
loc?LocationThe source location for this AST node, if location tracking was enabled.
alias?NameNodeThe response-key alias for this field, if one was supplied.
nameNameNodeName 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?SelectionSetNodeSelections made by this operation, field, or fragment.

ArgumentNode

Interface. An argument supplied to a field or directive.

Members

NameTypeDescription
kindARGUMENTThe discriminator identifying the concrete AST or introspection kind.
loc?LocationThe source location for this AST node, if location tracking was enabled.
nameNameNodeName node identifying this AST node.
valueValueNodeThe parsed value represented by this node.

ConstArgumentNode

Interface. An argument node whose value is guaranteed to be constant.

Members

NameTypeDescription
kindARGUMENTThe discriminator identifying the concrete AST or introspection kind.
loc?LocationThe source location for this AST node, if location tracking was enabled.
nameNameNodeName node identifying this AST node.
valueConstValueNodeThe parsed value represented by this node.

FragmentSpreadNode

Interface. A named fragment spread, such as ...userFields.

Members

NameTypeDescription
kindFRAGMENT_SPREADThe discriminator identifying the concrete AST or introspection kind.
loc?LocationThe source location for this AST node, if location tracking was enabled.
nameNameNodeName 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

NameTypeDescription
kindINLINE_FRAGMENTThe discriminator identifying the concrete AST or introspection kind.
loc?LocationThe source location for this AST node, if location tracking was enabled.
typeCondition?NamedTypeNodeThe type condition that limits where this fragment applies.
directives?readonly DirectiveNode[]Directives available in this schema or applied to this AST node.
selectionSetSelectionSetNodeSelections made by this operation, field, or fragment.

FragmentDefinitionNode

Interface. A reusable fragment definition declared in an executable document.

Members

NameTypeDescription
kindFRAGMENT_DEFINITIONThe discriminator identifying the concrete AST or introspection kind.
description?StringValueNodeThe optional GraphQL description associated with this definition.
loc?LocationThe source location for this AST node, if location tracking was enabled.
nameNameNodeName node identifying this AST node.
variableDefinitions?readonly VariableDefinitionNode[]
typeConditionNamedTypeNodeThe type condition that limits where this fragment applies.
directives?readonly DirectiveNode[]Directives available in this schema or applied to this AST node.
selectionSetSelectionSetNodeSelections 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

NameTypeDescription
kindINTThe discriminator identifying the concrete AST or introspection kind.
loc?LocationThe source location for this AST node, if location tracking was enabled.
valuestringThe parsed value represented by this node.

FloatValueNode

Interface. A floating-point value literal.

Members

NameTypeDescription
kindFLOATThe discriminator identifying the concrete AST or introspection kind.
loc?LocationThe source location for this AST node, if location tracking was enabled.
valuestringThe parsed value represented by this node.

StringValueNode

Interface. A string value literal.

Members

NameTypeDescription
kindSTRINGThe discriminator identifying the concrete AST or introspection kind.
loc?LocationThe source location for this AST node, if location tracking was enabled.
valuestringThe parsed value represented by this node.
block?booleanWhether this string was parsed from block string syntax.

BooleanValueNode

Interface. A boolean value literal.

Members

NameTypeDescription
kindBOOLEANThe discriminator identifying the concrete AST or introspection kind.
loc?LocationThe source location for this AST node, if location tracking was enabled.
valuebooleanThe parsed value represented by this node.

NullValueNode

Interface. A null value literal.

Members

NameTypeDescription
kindNULLThe discriminator identifying the concrete AST or introspection kind.
loc?LocationThe source location for this AST node, if location tracking was enabled.

EnumValueNode

Interface. An enum value literal.

Members

NameTypeDescription
kindENUMThe discriminator identifying the concrete AST or introspection kind.
loc?LocationThe source location for this AST node, if location tracking was enabled.
valuestringThe parsed value represented by this node.

ListValueNode

Interface. A list value literal.

Members

NameTypeDescription
kindLISTThe discriminator identifying the concrete AST or introspection kind.
loc?LocationThe source location for this AST node, if location tracking was enabled.
valuesreadonly ValueNode[]Values contained in this enum, list, or input-object definition.

ConstListValueNode

Interface. A list value literal whose elements are all constant values.

Members

NameTypeDescription
kindLISTThe discriminator identifying the concrete AST or introspection kind.
loc?LocationThe source location for this AST node, if location tracking was enabled.
valuesreadonly ConstValueNode[]Values contained in this enum, list, or input-object definition.

ObjectValueNode

Interface. An input object value literal.

Members

NameTypeDescription
kindOBJECTThe discriminator identifying the concrete AST or introspection kind.
loc?LocationThe source location for this AST node, if location tracking was enabled.
fieldsreadonly 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

NameTypeDescription
kindOBJECTThe discriminator identifying the concrete AST or introspection kind.
loc?LocationThe source location for this AST node, if location tracking was enabled.
fieldsreadonly ConstObjectFieldNode[]Fields declared by this object, interface, input object, or literal.

ObjectFieldNode

Interface. A field inside an input object value literal.

Members

NameTypeDescription
kindOBJECT_FIELDThe discriminator identifying the concrete AST or introspection kind.
loc?LocationThe source location for this AST node, if location tracking was enabled.
nameNameNodeName node identifying this AST node.
valueValueNodeThe parsed value represented by this node.

ConstObjectFieldNode

Interface. A field inside a constant input object value literal.

Members

NameTypeDescription
kindOBJECT_FIELDThe discriminator identifying the concrete AST or introspection kind.
loc?LocationThe source location for this AST node, if location tracking was enabled.
nameNameNodeName node identifying this AST node.
valueConstValueNodeThe parsed value represented by this node.

DirectiveNode

Interface. A directive applied to an executable or type-system location.

Members

NameTypeDescription
kindDIRECTIVEThe discriminator identifying the concrete AST or introspection kind.
loc?LocationThe source location for this AST node, if location tracking was enabled.
nameNameNodeName 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

NameTypeDescription
kindDIRECTIVEThe discriminator identifying the concrete AST or introspection kind.
loc?LocationThe source location for this AST node, if location tracking was enabled.
nameNameNodeName 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

NameTypeDescription
kindNAMED_TYPEThe discriminator identifying the concrete AST or introspection kind.
loc?LocationThe source location for this AST node, if location tracking was enabled.
nameNameNodeName node identifying this AST node.

ListTypeNode

Interface. A list type reference.

Members

NameTypeDescription
kindLIST_TYPEThe discriminator identifying the concrete AST or introspection kind.
loc?LocationThe source location for this AST node, if location tracking was enabled.
typeTypeNodeThe GraphQL type reference or runtime type for this element.

NonNullTypeNode

Interface. A non-null type reference.

Members

NameTypeDescription
kindNON_NULL_TYPEThe discriminator identifying the concrete AST or introspection kind.
loc?LocationThe source location for this AST node, if location tracking was enabled.
typeNamedTypeNode | ListTypeNodeThe 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

NameTypeDescription
kindSCHEMA_DEFINITIONThe discriminator identifying the concrete AST or introspection kind.
loc?LocationThe source location for this AST node, if location tracking was enabled.
description?StringValueNodeThe optional GraphQL description associated with this definition.
directives?readonly ConstDirectiveNode[]Directives available in this schema or applied to this AST node.
operationTypesreadonly 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

NameTypeDescription
kindOPERATION_TYPE_DEFINITIONThe discriminator identifying the concrete AST or introspection kind.
loc?LocationThe source location for this AST node, if location tracking was enabled.
operationOperationTypeNodeThe operation selected for execution.
typeNamedTypeNodeThe 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

NameTypeDescription
kindSCALAR_TYPE_DEFINITIONThe discriminator identifying the concrete AST or introspection kind.
loc?LocationThe source location for this AST node, if location tracking was enabled.
description?StringValueNodeThe optional GraphQL description associated with this definition.
nameNameNodeName 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

NameTypeDescription
kindOBJECT_TYPE_DEFINITIONThe discriminator identifying the concrete AST or introspection kind.
loc?LocationThe source location for this AST node, if location tracking was enabled.
description?StringValueNodeThe optional GraphQL description associated with this definition.
nameNameNodeName 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

NameTypeDescription
kindFIELD_DEFINITIONThe discriminator identifying the concrete AST or introspection kind.
loc?LocationThe source location for this AST node, if location tracking was enabled.
description?StringValueNodeThe optional GraphQL description associated with this definition.
nameNameNodeName node identifying this AST node.
arguments?readonly InputValueDefinitionNode[]Arguments supplied to this field, directive, or coordinate.
typeTypeNodeThe 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

NameTypeDescription
kindINPUT_VALUE_DEFINITIONThe discriminator identifying the concrete AST or introspection kind.
loc?LocationThe source location for this AST node, if location tracking was enabled.
description?StringValueNodeThe optional GraphQL description associated with this definition.
nameNameNodeName node identifying this AST node.
typeTypeNodeThe GraphQL type reference or runtime type for this element.
defaultValue?ConstValueNodeThe 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

NameTypeDescription
kindINTERFACE_TYPE_DEFINITIONThe discriminator identifying the concrete AST or introspection kind.
loc?LocationThe source location for this AST node, if location tracking was enabled.
description?StringValueNodeThe optional GraphQL description associated with this definition.
nameNameNodeName 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

NameTypeDescription
kindUNION_TYPE_DEFINITIONThe discriminator identifying the concrete AST or introspection kind.
loc?LocationThe source location for this AST node, if location tracking was enabled.
description?StringValueNodeThe optional GraphQL description associated with this definition.
nameNameNodeName 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

NameTypeDescription
kindENUM_TYPE_DEFINITIONThe discriminator identifying the concrete AST or introspection kind.
loc?LocationThe source location for this AST node, if location tracking was enabled.
description?StringValueNodeThe optional GraphQL description associated with this definition.
nameNameNodeName 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

NameTypeDescription
kindENUM_VALUE_DEFINITIONThe discriminator identifying the concrete AST or introspection kind.
loc?LocationThe source location for this AST node, if location tracking was enabled.
description?StringValueNodeThe optional GraphQL description associated with this definition.
nameNameNodeName 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

NameTypeDescription
kindINPUT_OBJECT_TYPE_DEFINITIONThe discriminator identifying the concrete AST or introspection kind.
loc?LocationThe source location for this AST node, if location tracking was enabled.
description?StringValueNodeThe optional GraphQL description associated with this definition.
nameNameNodeName 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

NameTypeDescription
kindDIRECTIVE_DEFINITIONThe discriminator identifying the concrete AST or introspection kind.
loc?LocationThe source location for this AST node, if location tracking was enabled.
description?StringValueNodeThe optional GraphQL description associated with this definition.
nameNameNodeName 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.
repeatablebooleanWhether this directive may appear more than once at the same location.
locationsreadonly 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

NameTypeDescription
kindSCHEMA_EXTENSIONThe discriminator identifying the concrete AST or introspection kind.
loc?LocationThe 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

NameTypeDescription
kindSCALAR_TYPE_EXTENSIONThe discriminator identifying the concrete AST or introspection kind.
loc?LocationThe source location for this AST node, if location tracking was enabled.
nameNameNodeName 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

NameTypeDescription
kindOBJECT_TYPE_EXTENSIONThe discriminator identifying the concrete AST or introspection kind.
loc?LocationThe source location for this AST node, if location tracking was enabled.
nameNameNodeName 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

NameTypeDescription
kindINTERFACE_TYPE_EXTENSIONThe discriminator identifying the concrete AST or introspection kind.
loc?LocationThe source location for this AST node, if location tracking was enabled.
nameNameNodeName 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

NameTypeDescription
kindUNION_TYPE_EXTENSIONThe discriminator identifying the concrete AST or introspection kind.
loc?LocationThe source location for this AST node, if location tracking was enabled.
nameNameNodeName 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

NameTypeDescription
kindENUM_TYPE_EXTENSIONThe discriminator identifying the concrete AST or introspection kind.
loc?LocationThe source location for this AST node, if location tracking was enabled.
nameNameNodeName 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

NameTypeDescription
kindINPUT_OBJECT_TYPE_EXTENSIONThe discriminator identifying the concrete AST or introspection kind.
loc?LocationThe source location for this AST node, if location tracking was enabled.
nameNameNodeName 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

NameTypeDescription
kindDIRECTIVE_EXTENSIONThe discriminator identifying the concrete AST or introspection kind.
loc?LocationThe source location for this AST node, if location tracking was enabled.
nameNameNodeName 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

NameTypeDescription
kindTYPE_COORDINATEThe discriminator identifying the concrete AST or introspection kind.
loc?LocationThe source location for this AST node, if location tracking was enabled.
nameNameNodeName node identifying this AST node.

MemberCoordinateNode

Interface. A schema coordinate that refers to a member of a named type.

Members

NameTypeDescription
kindMEMBER_COORDINATEThe discriminator identifying the concrete AST or introspection kind.
loc?LocationThe source location for this AST node, if location tracking was enabled.
nameNameNodeName node identifying this AST node.
memberNameNameNodeThe member name referenced by this schema coordinate.

ArgumentCoordinateNode

Interface. A schema coordinate that refers to a field or directive argument.

Members

NameTypeDescription
kindARGUMENT_COORDINATEThe discriminator identifying the concrete AST or introspection kind.
loc?LocationThe source location for this AST node, if location tracking was enabled.
nameNameNodeName node identifying this AST node.
fieldNameNameNodeThe field name referenced by this schema coordinate.
argumentNameNameNodeThe argument name referenced by this schema coordinate.

DirectiveCoordinateNode

Interface. A schema coordinate that refers to a directive.

Members

NameTypeDescription
kindDIRECTIVE_COORDINATEThe discriminator identifying the concrete AST or introspection kind.
loc?LocationThe source location for this AST node, if location tracking was enabled.
nameNameNodeName node identifying this AST node.

DirectiveArgumentCoordinateNode

Interface. A schema coordinate that refers to a directive argument.

Members

NameTypeDescription
kindDIRECTIVE_ARGUMENT_COORDINATEThe discriminator identifying the concrete AST or introspection kind.
loc?LocationThe source location for this AST node, if location tracking was enabled.
nameNameNodeName node identifying this AST node.
argumentNameNameNodeThe argument name referenced by this schema coordinate.