@@ -124,13 +124,14 @@ export type ASTNode =
124124 | EnumTypeDefinitionNode
125125 | EnumValueDefinitionNode
126126 | InputObjectTypeDefinitionNode
127+ | DirectiveDefinitionNode
128+ | SchemaExtensionNode
127129 | ScalarTypeExtensionNode
128130 | ObjectTypeExtensionNode
129131 | InterfaceTypeExtensionNode
130132 | UnionTypeExtensionNode
131133 | EnumTypeExtensionNode
132- | InputObjectTypeExtensionNode
133- | DirectiveDefinitionNode ;
134+ | InputObjectTypeExtensionNode ;
134135
135136/**
136137 * Utility type listing all nodes indexed by their kind.
@@ -171,13 +172,14 @@ export type ASTKindToNode = {
171172 EnumTypeDefinition : EnumTypeDefinitionNode ,
172173 EnumValueDefinition : EnumValueDefinitionNode ,
173174 InputObjectTypeDefinition : InputObjectTypeDefinitionNode ,
175+ DirectiveDefinition : DirectiveDefinitionNode ,
176+ SchemaExtension : SchemaExtensionNode ,
174177 ScalarTypeExtension : ScalarTypeExtensionNode ,
175178 ObjectTypeExtension : ObjectTypeExtensionNode ,
176179 InterfaceTypeExtension : InterfaceTypeExtensionNode ,
177180 UnionTypeExtension : UnionTypeExtensionNode ,
178181 EnumTypeExtension : EnumTypeExtensionNode ,
179182 InputObjectTypeExtension : InputObjectTypeExtensionNode ,
180- DirectiveDefinition : DirectiveDefinitionNode ,
181183} ;
182184
183185// Name
@@ -198,7 +200,8 @@ export type DocumentNode = {
198200
199201export type DefinitionNode =
200202 | ExecutableDefinitionNode
201- | TypeSystemDefinitionNode ; // experimental non-spec addition.
203+ | TypeSystemDefinitionNode
204+ | TypeSystemExtensionNode ;
202205
203206export type ExecutableDefinitionNode =
204207 | OperationDefinitionNode
@@ -388,13 +391,12 @@ export type NonNullTypeNode = {
388391export type TypeSystemDefinitionNode =
389392 | SchemaDefinitionNode
390393 | TypeDefinitionNode
391- | TypeExtensionNode
392394 | DirectiveDefinitionNode ;
393395
394396export type SchemaDefinitionNode = {
395397 + kind : 'SchemaDefinition' ,
396398 + loc ? : Location ,
397- + directives : $ReadOnlyArray < DirectiveNode > ,
399+ + directives ? : $ReadOnlyArray < DirectiveNode > ,
398400 + operationTypes : $ReadOnlyArray < OperationTypeDefinitionNode > ,
399401} ;
400402
@@ -497,6 +499,28 @@ export type InputObjectTypeDefinitionNode = {
497499 + fields ?: $ReadOnlyArray < InputValueDefinitionNode > ,
498500} ;
499501
502+ // Directive Definitions
503+
504+ export type DirectiveDefinitionNode = {
505+ + kind : 'DirectiveDefinition' ,
506+ + loc ? : Location ,
507+ + description ? : StringValueNode ,
508+ + name : NameNode ,
509+ + arguments ?: $ReadOnlyArray < InputValueDefinitionNode > ,
510+ + locations : $ReadOnlyArray < NameNode > ,
511+ } ;
512+
513+ // Type System Extensions
514+
515+ export type TypeSystemExtensionNode = SchemaExtensionNode | TypeExtensionNode ;
516+
517+ export type SchemaExtensionNode = {
518+ + kind : 'SchemaExtension' ,
519+ + loc ? : Location ,
520+ + directives ?: $ReadOnlyArray < DirectiveNode > ,
521+ + operationTypes ?: $ReadOnlyArray < OperationTypeDefinitionNode > ,
522+ } ;
523+
500524// Type Extensions
501525
502526export type TypeExtensionNode =
@@ -554,14 +578,3 @@ export type InputObjectTypeExtensionNode = {
554578 + directives ?: $ReadOnlyArray < DirectiveNode > ,
555579 + fields ?: $ReadOnlyArray < InputValueDefinitionNode > ,
556580} ;
557-
558- // Directive Definitions
559-
560- export type DirectiveDefinitionNode = {
561- + kind : 'DirectiveDefinition' ,
562- + loc ? : Location ,
563- + description ? : StringValueNode ,
564- + name : NameNode ,
565- + arguments ?: $ReadOnlyArray < InputValueDefinitionNode > ,
566- + locations : $ReadOnlyArray < NameNode > ,
567- } ;
0 commit comments