Skip to content

Commit f89de40

Browse files
committed
Document directives are not special
1 parent 3a86550 commit f89de40

File tree

3 files changed

+2
-36
lines changed

3 files changed

+2
-36
lines changed

spec/Appendix B -- Grammar Summary.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,17 +91,13 @@ lines and uniform indentation with {BlockStringValue()}.
9191

9292
## Document
9393

94-
Document : Definition+
94+
Document : Directives[Const]? Definition+
9595

9696
Definition :
97-
- DocumentDirective
9897
- ExecutableDefinition
9998
- TypeSystemDefinition
10099
- TypeSystemExtension
101100

102-
DocumentDirective :
103-
- Directive[Const]
104-
105101
ExecutableDefinition :
106102
- OperationDefinition
107103
- FragmentDefinition

spec/Section 2 -- Language.md

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -169,10 +169,9 @@ characters to support interoperation with as many other systems as possible.
169169

170170
## Document
171171

172-
Document : Definition+
172+
Document : Directives[Const]? Definition+
173173

174174
Definition :
175-
- DocumentDirective
176175
- ExecutableDefinition
177176
- TypeSystemDefinition
178177
- TypeSystemExtension
@@ -1095,24 +1094,3 @@ and operations.
10951094

10961095
As future versions of GraphQL adopt new configurable execution capabilities,
10971096
they may be exposed via directives.
1098-
1099-
1100-
## Document Directives
1101-
1102-
DocumentDirective :
1103-
- Directive[Const]
1104-
1105-
{DocumentDirective} is special kind of {Definition} and should be handled
1106-
on AST level by implementation in similar way like {TypeSystemDefinition}
1107-
or {ExecutableDefinition}.
1108-
1109-
Documents of any kind may contain zero or more {DocumentDirective}s.
1110-
Same directive may be repeated multiple times at document level:
1111-
1112-
```graphql example
1113-
@import(from: "./common")
1114-
@import(from: "./user")
1115-
```
1116-
1117-
Unknown directives may be ignored, but it is recommended for services to fail
1118-
if directive is not recognized.

spec/Section 3 -- Type System.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1672,14 +1672,6 @@ directive @example on
16721672
| INLINE_FRAGMENT
16731673
```
16741674

1675-
Special directive location `DOCUMENT` allows free top level directives:
1676-
1677-
```graphql example
1678-
directive @import(from: String! only:[String!]) on DOCUMENT
1679-
1680-
@import(from: "./common.graphql")
1681-
```
1682-
16831675
Directives can also be used to annotate the type system definition language
16841676
as well, which can be a useful tool for supplying additional metadata in order
16851677
to generate GraphQL execution services, produce client generated runtime code,

0 commit comments

Comments
 (0)