Skip to content

Add support for empty input object types - #4923

Closed
DaleSeo wants to merge 1 commit into
graphql:17.x.xfrom
DaleSeo:empty-input-object-types
Closed

DaleSeo wants to merge 1 commit into
graphql:17.x.xfrom
DaleSeo:empty-input-object-types

Conversation

@DaleSeo

@DaleSeo DaleSeo commented Oct 29, 2026 •

Copy link
Copy Markdown

Implementation for graphql/graphql-spec#1249, which allows input object types to have no fields. It follows the same pattern as #4862 for empty object types. This adds a new experimental flag, experimentalAllowEmptyInputObjectTypes, to ParseOptions and GraphQLSchema, and passes it through buildSchema, buildASTSchema, buildClientSchema, and extendSchema.

When the flag is enabled, the parser accepts input Empty {}, and schema validation allows input objects with no fields. OneOf input objects must still have at least one field, since an empty @oneOf input object can never have a valid value. This also reflects the open question in the spec PR. The flag is off by default, so existing behavior remains unchanged.

@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 15:16
@DaleSeo
DaleSeo marked this pull request as draft October 29, 2026 15:17
@DaleSeo DaleSeo closed this Nov 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant