graphql / graphql/graphql-spec
[Validation] "root types exist" should be a formal validation
Open
👻 Needs Champion
💭 Strawman (RFC 0)
- Dominant language
- JavaScript
- Stars
- 14.6k
- Forks
- 1.2k
- PR merge metrics
- No merged PRs in 30d
Description
A GraphQL schema _must_ have a query root, but mutation and subscription roots are optional. If a schema doesn't have a mutation root, `mutation` operations are invalid. Same for `subscription`: if there's no `subscription` root type, we should reject a document with an operation on `subscription`.
We have this validation in graphql-ruby _now_ (thanks @cjoudrey) but we didn't at first, because I was _literally_ reading the spec and implementing the rules one-by-one.
Should that rule be in the spec? If so, I'm happy to try writing up (I think I have a bow tie around here somewhere 😆 ).
Contributor guide
Assessment
This issue has not been assessed yet.