Skip to content

test: accept non-null union implementing a nullable union interface field - #4851

Open
jayphelps wants to merge 1 commit into
graphql:17.x.xfrom
jayphelps:agent/non-null-union-interface-20260828-a160
Open

test: accept non-null union implementing a nullable union interface field#4851
jayphelps wants to merge 1 commit into
graphql:17.x.xfrom
jayphelps:agent/non-null-union-interface-20260828-a160

Conversation

@jayphelps

@jayphelps jayphelps commented Aug 29, 2026

Copy link
Copy Markdown

Adds schema validation coverage for implementing a nullable union interface field with the non-null union (SomeUnionType! implementing SomeUnionType).

That case is already allowed by isTypeSubTypeOf (Non-Null is unwrapped before the abstract-type check) and by spec IsValidImplementationFieldType. The existing tests only covered it for scalars (String! / String) and for a nullable union member (SomeObject / SomeUnionType), not this combination.

graphql-java recently found it did not accept this schema (#4467): the union check ran before Non-Null unwrapping, so U! implementing U was rejected even though the spec allows it. graphql-js already does the right thing. Pinning that down with a test makes the behavior explicit as as-designed, rather than an accident of the comparator order.

Object and interface implementers, next to the existing "subset non-null Interface field type" tests.

…ield

Co-authored-by: Cursor <cursoragent@cursor.com>
@linux-foundation-easycla

linux-foundation-easycla Bot commented Aug 29, 2026

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: jayphelps / name: Jay Phelps (d57ace1)

@vercel

vercel Bot commented Aug 29, 2026

Copy link
Copy Markdown

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

A member of the Team first needs to authorize it.

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