File tree Expand file tree Collapse file tree 2 files changed +25
-1
lines changed
Expand file tree Collapse file tree 2 files changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -94,10 +94,14 @@ lines and uniform indentation with {BlockStringValue()}.
9494Document : Definition+
9595
9696Definition :
97+ - DocumentDirective
9798 - ExecutableDefinition
9899 - TypeSystemDefinition
99100 - TypeSystemExtension
100101
102+ DocumentDirective :
103+ - Directive[ Const]
104+
101105ExecutableDefinition :
102106 - OperationDefinition
103107 - FragmentDefinition
Original file line number Diff line number Diff line change @@ -172,6 +172,7 @@ characters to support interoperation with as many other systems as possible.
172172Document : Definition+
173173
174174Definition :
175+ - DocumentDirective
175176 - ExecutableDefinition
176177 - TypeSystemDefinition
177178 - TypeSystemExtension
@@ -202,7 +203,6 @@ GraphQL services which only seek to provide GraphQL query execution may choose
202203to only include {ExecutableDefinition} and omit the {TypeSystemDefinition} and
203204{TypeSystemExtension} rules from {Definition}.
204205
205-
206206## Operations
207207
208208OperationDefinition :
@@ -1094,3 +1094,23 @@ and operations.
10941094
10951095As future versions of GraphQL adopt new configurable execution capabilities,
10961096they may be exposed via directives.
1097+
1098+ ## Document Directives
1099+
1100+ DocumentDirective :
1101+ - Directive[ Const]
1102+
1103+ {DocumentDirective} is special kind of {Definition} and should be handled
1104+ on AST level by implementation in similar way like {TypeSystemDefinition}
1105+ or {ExecutableDefinition}.
1106+
1107+ Documents of any kind may contain zero or more {DocumentDirective}s.
1108+ Same directive may be repeated multiple times at document level:
1109+
1110+ ``` graphql example
1111+ @import (from : " ./common" )
1112+ @import (from : " ./user" )
1113+ ```
1114+
1115+ Unknown directives may be ignored , but it is recommended for services to fail
1116+ if directive is not recognized .
You can’t perform that action at this time.
0 commit comments