At a glance
- Project
- GraphQL Spec
- Identifier
- #1230
- Stage
- RFC 0 / Strawman
- Champion
- @benjie
- Updated
- 2026-07-02
- Latest activity
- Added to WG agenda on
- Source
- Pull request
Pull request description
Introspection should describe a consistent schema. The rules of the GraphQL schema validation aim that there are at least two consistent schemas (PR to follow to make this more explicit...): the source schema, and a derived schema that has all deprecated elements removed. Currently, however, an inconsistent schema can be described by mixing different values into includeDeprecated arguments throughout introspection. Worse, because includeDeprecated defaults to false, every time a new feature of the schema can be deprecated, existing schema introspection queries can start to represent an invalid schema as newly deprecated entities may be excluded even though includeDeprecated: true is specified for all previous introspection fields.
This PR aims to eliminate this inconsistency by deprecating the old includeDeprecated: system and replacing it with a __schema-level includeDeprecated argument that applies recursively. This however requires some further changes:
- Other
includeDeprecatedarguments would conflict with the__schema-levelincludeDeprecated, so they are forbidden when it's specified. - Since
includeDeprecatedisfalseby default, specifying__schema(includeDeprecated: true)would still describe the un-deprecated portions of the schema; thus the existingincludeDeprecatedarguments must lose their default value and become optional (which currently means nullable).
Were it the case that includeDeprecated had had the default value true throughout history, this change could have been accomplished by simply adding __schema(includeDeprecated: Boolean! = true), since {__schema(includeDeprecated: false) {...}} would represent a schema with all deprecated elements removed independent of any nested includeDeprecated arguments. Alas, we defaulted to false and thus to allow includeDeprecated: true at the root level we need to put in more effort.
Possible expansion: we could make the validation rule stricter: forbid literal null, and require that a variable in that position is defined as non-nullable. I didn't see sufficient value in this to justify adding it, but I'm happy to do so if others think it's worthwhile.
Timeline
July 2026
- On the agenda for GraphQL WG
8 listed attendees · 10 agenda items · 7 linked RFCs
- Best practice: writing robust applications (2m, Martin)
- OneOf Inhabitatability (5m, James) #1211
- OTEL Semantic Conventions (5m, Pascal)
- Sibling errors should not be added after propagation (5m, Benjie) #1184
- Allow empty selection sets (5m, Benjie) #1227
- Allow empty object types (5m, Benjie) #1228
- Allow interfaces with no fields, unions with no members (10m, Benjie) #1229
- A schema with all deprecated elements removed must itself be valid (10m, Benjie) #1231
- Deprecate includeDeprecated, add __schema(includeDeprecated:) (15m, Benjie) #1230
- GraphQL-over-HTTP first release (15m, Benjie)
June 2026
- Pull request created on by benjie
- @benjie committed "Add validation rule" on
- Advanced to RFC 0 on by benjie
- @benjie committed "Deprecate `includeDeprecated` at field level, add at schema level" on