At a glance
- Identifier: #1211
- Stage: RFC 1 / Proposal
- Champion: @jbellenger
- Latest activity: Added to WG agenda on 2026-03-05
- Spec PR: https://github.com/graphql/graphql-spec/pull/1211
Spec PR description
OneOf types can form graphs for which finite values cannot be created.
The simplest example of this is a self-recursing OneOf type:
input A @oneOf { a:A }
While this is the simplest form, OneOfs can also be combined with non-OneOf input object types to create other uninhabited types:
input A @oneOf { b:B }
input B { a:A! }
These kinds of types are considered valid on two fronts today:
- They are valid as OneOf types because all field types are nullable and there are no default values
- They are valid as a circular input object because there are no unbreakable chains of non-null non-list fields
While this follows the letter of the Circular References part of the spec, it violates the spirit of the spec in that there is no way to create a finite, legal value for these types. I propose that these topologies be declared invalid.
I took a stab at reworking the Circular References section to consider OneOfs and added a more formal specification framed around finite values.
Timeline
- Added to WG agenda on 2026-03-05
- Commit pushed on 2026-03-03 by jbellenger: feedback
- Commit pushed on 2026-02-28 by jbellenger: feedback
- Commit pushed on 2026-02-26 by jbellenger: rework circular references section
- Spec PR created on 2026-02-17 by jbellenger
- Commit pushed on 2026-02-16 by jbellenger: spec edits for OneOf inhabitability