graphql / graphql/graphql-spec

Grammar should have single root node

Open
#1,031 2 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.