RFC 1 / Proposal

OneOf inhabitability

Opened on2026-02-16
Updated on2026-03-06

At a glance

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:

  1. They are valid as OneOf types because all field types are nullable and there are no default values
  2. 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