Skip to content

feat: add experimentalAllowEmptyTypes for empty types - #4934

Open
DaleSeo wants to merge 7 commits into
graphql:17.x.xfrom
DaleSeo:experimental-allow-empty-types
Open

DaleSeo wants to merge 7 commits into
graphql:17.x.xfrom
DaleSeo:experimental-allow-empty-types

Conversation

@DaleSeo

@DaleSeo DaleSeo commented Oct 29, 2026 •

Copy link
Copy Markdown

This brings all the empty-type work together in one PR behind a single experimentalAllowEmptyTypes flag. The flag covers the following spec proposals:

When the flag is enabled, empty types are written with braces: type Empty {}, interface Empty {}, input Empty {}, and union Empty = {}. A bare definition such as type Empty stays incomplete, and validation rejects it unless an extension completes it, for example extend type Empty {}. This follows the approach the Nov 5 Working Group agreed. The parser accepts the empty forms only with the flag, and printSchema prints them with braces when the schema has the flag set.

An empty Query root type is allowed, but Mutation and Subscription root types still need at least one field. OneOf input objects also still need at least one field, since an empty OneOf input object can never have a valid value.

This supersedes #4862, #4863, and #4923. Those can be closed if this approach is preferred.

@vercel

vercel Bot commented Oct 29, 2026

Copy link
Copy Markdown

@DaleSeo is attempting to deploy a commit to the The GraphQL Foundation Team on Vercel.

A member of the Team first needs to authorize it.

@DaleSeo
DaleSeo marked this pull request as ready for review October 29, 2026 19:17
@martinbonnin

Copy link
Copy Markdown
Contributor

Simple 👍 I like it.
It's also the route we took in Apollo Kotlin: apollographql/apollo-kotlin#7043

@DaleSeo
DaleSeo force-pushed the experimental-allow-empty-types branch from 5e25199 to 8ed2d11 Compare November 6, 2026 14:23
@yaacovCR yaacovCR added spec RFC Implementation of a proposed change to the GraphQL specification PR: feature 🚀 requires increase of "minor" version number labels Nov 8, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: feature 🚀 requires increase of "minor" version number spec RFC Implementation of a proposed change to the GraphQL specification

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants