RFC 3 / Accepted

Add validation rule that operation types exist

Opened on2022-06-01
Merged on2025-06-26

At a glance

Spec PR description

Right now the spec says that, for example, if the schema does not define a mutation root type, then the schema does not support mutations. But there's no validation rule for it, which means that many parsers (including graphql-js) treat a mutation as valid against such a schema. (Indeed, many end up considering any mutation as valid, since they don't know what type to validate the root selection set against.) This commit adds a validation rule to make the schema text explicit.

Slated for discussion at the June 2 2022 working group meeting. Replaces #947. See also graphql/graphql-js#3592.


Update October 2024: this PR has been refreshed including changes proposed in #1098 and Benjie's editorial edits.

Fixes #1097

Timeline