Skip to content

Make __type introspection field nullable - #1402

Merged
LegNeato merged 1 commit into
graphql-rust:masterfrom
LegNeato:fix-type-nullability
Oct 29, 2026
Merged

LegNeato merged 1 commit into
graphql-rust:masterfrom
LegNeato:fix-type-nullability

Conversation

@LegNeato

Copy link
Copy Markdown
Member

The GraphQL spec defines __type(name: String!): __Type as nullable. Juniper declared the field as __Type!. A query for an unknown type then returned null data without errors. The same query now returns {"__type": null}.

This PR also unblocks #1397. The CI of #1397 fails in the codegen_scalar_attr_type_alias test because of this bug.

The beta and nightly CI jobs also fail on master. #1401 fixes them.

@LegNeato
LegNeato force-pushed the fix-type-nullability branch 2 times, most recently from 1508920 to 728868a Compare October 28, 2026 22:29
The GraphQL spec defines `__type(name: String!): __Type` as nullable.
Juniper declared the field as `__Type!`. A query for an unknown type
then returned `null` data without errors because the `null` value of
`__type` propagated to the response root.
@LegNeato
LegNeato force-pushed the fix-type-nullability branch from 728868a to 91c0e16 Compare October 29, 2026 00:02
@LegNeato
LegNeato merged commit 2fd34a4 into graphql-rust:master Oct 29, 2026
184 checks passed
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