graphql / graphql/graphql-spec
Grammar should have single root node
- Dominant language
- JavaScript
- Stars
- 14.6k
- Forks
- 1.2k
- PR merge metrics
- No merged PRs in 30d
Description
Currently, the GraphQL grammar defines four root nodes that don't have a parent node: `Document`, an `ExecutableDocument`, a `TypeSystemDocument` and a `TypeSystemExtensionDocument`.
Lacking a unique root node makes the spec ambiguous, as it could refer to any of the four grammars defined by these four root nodes.
The grammar should be explicitly defined by introducing a single wrapping root node like
```
GraphQLDocument
Document
ExecutableDocument
TypeSystemDocument
TypeSystemExtensionDocument
```
Allowing services to support some documents and not others doesn't need to come at the cost of an ambiguous grammar. It can instead be defined in accompanying prose.
Contributor guide
Assessment
This issue has not been assessed yet.