SourceCharacter :: "Any Unicode scalar value"
Ignored ::
- UnicodeBOM
- Whitespace
- LineTerminator
- Comment
- Comma
UnicodeBOM :: "Byte Order Mark (U+FEFF)"
Whitespace ::
- "Horizontal Tab (U+0009)"
- "Space (U+0020)"
LineTerminator ::
- "New Line (U+000A)"
- "Carriage Return (U+000D)" [lookahead != "New Line (U+000A)"]
- "Carriage Return (U+000D)" "New Line (U+000A)"
Comment :: # CommentChar* [lookahead != CommentChar]
CommentChar :: SourceCharacter but not LineTerminator
Comma :: ,
Token ::
- Punctuator
- Name
- IntValue
- FloatValue
- StringValue
Punctuator :: one of ! $ & ( ) ... : = @ [ ] { | }
Name ::
- NameStart NameContinue* [lookahead != NameContinue]
NameStart ::
- Letter
_
NameContinue ::
- Letter
- Digit
_
Letter :: one of
ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
Digit :: one of
0123456789
IntValue :: IntegerPart [lookahead != {Digit, ., NameStart}]
IntegerPart ::
- NegativeSign? 0
- NegativeSign? NonZeroDigit Digit*
NegativeSign :: -
NonZeroDigit :: Digit but not 0
FloatValue ::
- IntegerPart FractionalPart ExponentPart [lookahead != {Digit,
., NameStart}] - IntegerPart FractionalPart [lookahead != {Digit,
., NameStart}] - IntegerPart ExponentPart [lookahead != {Digit,
., NameStart}]
FractionalPart :: . Digit+
ExponentPart :: ExponentIndicator Sign? Digit+
ExponentIndicator :: one of e E
Sign :: one of + -
StringValue ::
""[lookahead !="]"StringCharacter+"- BlockString
StringCharacter ::
- SourceCharacter but not
"or\or LineTerminator \uEscapedUnicode\EscapedCharacter
EscapedUnicode ::
{HexDigit+}- HexDigit HexDigit HexDigit HexDigit
HexDigit :: one of
0123456789ABCDEFabcdef
EscapedCharacter :: one of " \ / b f n r t
BlockString :: """ BlockStringCharacter* """
BlockStringCharacter ::
- SourceCharacter but not
"""or\""" \"""
Note: Block string values are interpreted to exclude blank initial and trailing lines and uniform indentation with {BlockStringValue()}.
Description : StringValue
Document : Definition+
Definition :
- ExecutableDefinition
- TypeSystemDefinitionOrExtension
ExecutableDocument : ExecutableDefinition+
ExecutableDefinition :
- OperationDefinition
- FragmentDefinition
OperationDefinition :
- Description? OperationType Name? VariablesDefinition? Directives? SelectionSet
- SelectionSet
OperationType : one of query mutation subscription
SelectionSet : { Selection+ }
Selection :
- Field
- FragmentSpread
- InlineFragment
Field : Alias? Name Arguments? Directives? SelectionSet?
Alias : Name :
Arguments[Const] : ( Argument[?Const]+ )
Argument[Const] : Name : Value[?Const]
FragmentSpread : ... FragmentName Directives?
InlineFragment : ... TypeCondition? Directives? SelectionSet
FragmentDefinition : Description? fragment FragmentName TypeCondition Directives? SelectionSet
FragmentName : Name but not on
TypeCondition : on NamedType
Value[Const] :
- [~Const] Variable
- IntValue
- FloatValue
- StringValue
- BooleanValue
- NullValue
- EnumValue
- ListValue[?Const]
- ObjectValue[?Const]
BooleanValue : one of true false
NullValue : null
EnumValue : Name but not true, false or null
ListValue[Const] :
- [ ]
- [ Value[?Const]+ ]
ObjectValue[Const] :
- { }
- { ObjectField[?Const]+ }
ObjectField[Const] : Name : Value[?Const]
VariablesDefinition : ( VariableDefinition+ )
VariableDefinition : Description? Variable : Type DefaultValue? Directives[Const]?
Variable : $ Name
DefaultValue : = Value[Const]
Type :
- NamedType
- ListType
- NonNullType
NamedType : Name
ListType : [ Type ]
NonNullType :
- NamedType !
- ListType !
Directives[Const] : Directive[?Const]+
Directive[Const] : @ Name Arguments[?Const]?
TypeSystemDocument : TypeSystemDefinition+
TypeSystemDefinition :
- SchemaDefinition
- TypeDefinition
- DirectiveDefinition
TypeSystemExtensionDocument : TypeSystemDefinitionOrExtension+
TypeSystemDefinitionOrExtension :
- TypeSystemDefinition
- TypeSystemExtension
TypeSystemExtension :
- SchemaExtension
- TypeExtension
SchemaDefinition : Description? schema Directives[Const]? { RootOperationTypeDefinition+ }
SchemaExtension :
- extend schema Directives[Const]? { RootOperationTypeDefinition+ }
- extend schema Directives[Const] [lookahead !=
{]
RootOperationTypeDefinition : OperationType : NamedType
TypeDefinition :
- ScalarTypeDefinition
- ObjectTypeDefinition
- InterfaceTypeDefinition
- UnionTypeDefinition
- EnumTypeDefinition
- InputObjectTypeDefinition
TypeExtension :
- ScalarTypeExtension
- ObjectTypeExtension
- InterfaceTypeExtension
- UnionTypeExtension
- EnumTypeExtension
- InputObjectTypeExtension
ScalarTypeDefinition : Description? scalar Name Directives[Const]?
ScalarTypeExtension :
- extend scalar Name Directives[Const]
ObjectTypeDefinition :
- Description? type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition
- Description? type Name ImplementsInterfaces? Directives[Const]? [lookahead !=
{]
ObjectTypeExtension :
- extend type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition
- extend type Name ImplementsInterfaces? Directives[Const] [lookahead !=
{] - extend type Name ImplementsInterfaces [lookahead !=
{]
ImplementsInterfaces :
- ImplementsInterfaces & NamedType
- implements
&? NamedType
FieldsDefinition : { FieldDefinition+ }
FieldDefinition : Description? Name ArgumentsDefinition? : Type Directives[Const]?
ArgumentsDefinition : ( InputValueDefinition+ )
InputValueDefinition : Description? Name : Type DefaultValue? Directives[Const]?
InterfaceTypeDefinition :
- Description? interface Name ImplementsInterfaces? Directives[Const]? FieldsDefinition
- Description? interface Name ImplementsInterfaces? Directives[Const]?
[lookahead !=
{]
InterfaceTypeExtension :
- extend interface Name ImplementsInterfaces? Directives[Const]? FieldsDefinition
- extend interface Name ImplementsInterfaces? Directives[Const] [lookahead !=
{] - extend interface Name ImplementsInterfaces [lookahead !=
{]
UnionTypeDefinition : Description? union Name Directives[Const]? UnionMemberTypes?
UnionMemberTypes :
- UnionMemberTypes | NamedType
- =
|? NamedType
UnionTypeExtension :
- extend union Name Directives[Const]? UnionMemberTypes
- extend union Name Directives[Const]
EnumTypeDefinition :
- Description? enum Name Directives[Const]? EnumValuesDefinition
- Description? enum Name Directives[Const]? [lookahead !=
{]
EnumValuesDefinition : { EnumValueDefinition+ }
EnumValueDefinition : Description? EnumValue Directives[Const]?
EnumTypeExtension :
- extend enum Name Directives[Const]? EnumValuesDefinition
- extend enum Name Directives[Const] [lookahead !=
{]
InputObjectTypeDefinition :
- Description? input Name Directives[Const]? InputFieldsDefinition
- Description? input Name Directives[Const]? [lookahead !=
{]
InputFieldsDefinition : { InputValueDefinition+ }
InputObjectTypeExtension :
- extend input Name Directives[Const]? InputFieldsDefinition
- extend input Name Directives[Const] [lookahead !=
{]
DirectiveDefinition : Description? directive @ Name ArgumentsDefinition?
repeatable? on DirectiveLocations
DirectiveLocations :
- DirectiveLocations | DirectiveLocation
|? DirectiveLocation
DirectiveLocation :
- ExecutableDirectiveLocation
- TypeSystemDirectiveLocation
ExecutableDirectiveLocation : one of
QUERYMUTATIONSUBSCRIPTIONFIELDFRAGMENT_DEFINITIONFRAGMENT_SPREADINLINE_FRAGMENTVARIABLE_DEFINITION
TypeSystemDirectiveLocation : one of
SCHEMASCALAROBJECTFIELD_DEFINITIONARGUMENT_DEFINITIONINTERFACEUNIONENUMENUM_VALUEINPUT_OBJECTINPUT_FIELD_DEFINITION
Note: Schema coordinates must not contain {Ignored}.
SchemaCoordinateToken ::
- SchemaCoordinatePunctuator
- Name
SchemaCoordinatePunctuator :: one of ( ) . : @
SchemaCoordinate ::
- TypeCoordinate
- MemberCoordinate
- ArgumentCoordinate
- DirectiveCoordinate
- DirectiveArgumentCoordinate
TypeCoordinate :: Name
MemberCoordinate :: Name . Name
ArgumentCoordinate :: Name . Name ( Name : )
DirectiveCoordinate :: @ Name
DirectiveArgumentCoordinate :: @ Name ( Name : )