RFC 3 / Accepted

Add validation rule that operation types exist

Opened on
Merged on

At a glance

Project
GraphQL Spec
Identifier
#955
Stage
RFC 3 / Accepted
Champion
@benjaminjkraft
Updated
2025-06-26
Latest activity
Pull request merged on
Source

Pull request 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

June 2025

  • Pull request merged on by leebyron
  • Advanced to RFC 3 on by leebyron
  • On the agenda for GraphQL WG

    7 listed attendees · 10 agenda items · 10 linked RFCs

    • RFC2: Schema coordinates (5m, Mark) #794
    • Appendix C - specified definitions
    • RFC2: Descriptions on executable definitions (5m, Stephen) #1170
    • Editorial: Define "execution result" and "request error result" (5m, Rob)
    • RFC1: Brushing off @deprecated on Objects (5m, Stephen) #997
    • RFC2: Keep schema keyword if description exists (2m, Benjie) #1167
    • RFC2: Data collections trilogy (2m, Benjie) #1102 #1092 #1063
    • RFC2: Add validation rule that operation types exist (2m, Benjie) #955
    • RFC1: Fix CoerceArgumentValues() hasValue (10m, Benjie) #1056
    • RFC1: List coercion algorithm (10m, Benjie) #1058

December 2024

October 2024

June 2024

May 2024

June 2022