Skip to content

Fix error propagation in fragments spreading (#1287) #1318

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
May 8, 2025

Conversation

tyranron
Copy link
Member

@tyranron tyranron commented May 8, 2025

Resolves #1287

Synopsis

See #1287 (comment):

Relevant excerpt from the GraphQL spec about how to handle field errors on non-nullable fields.

Since Non-Null type fields cannot be null, field errors are propagated to be handled by the parent field. If the parent field may be null then it resolves to null, otherwise if it is a Non-Null type, the field error is further propagated to its parent field.

Juniper follows this behavior when the query doesn't have any fragments, but if the field error only occurs in a fragment, "null" won't propagate to the closest nullable ancestor field, but instead seems to just make the fields in the fragment null, while not affecting fields outside of the fragment.

Solution

Make fragment and non-fragment behave similarly.

@tyranron tyranron added this to the 0.17.0 milestone May 8, 2025
@tyranron tyranron self-assigned this May 8, 2025
@tyranron tyranron added enhancement Improvement of existing features or bugfix k::design Related to overall design and/or architecture labels May 8, 2025
@tyranron tyranron marked this pull request as ready for review May 8, 2025 19:45
@tyranron tyranron merged commit dee3890 into master May 8, 2025
180 checks passed
@tyranron tyranron deleted the 1287-fix-error-propagation-in-fragments branch May 8, 2025 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improvement of existing features or bugfix k::design Related to overall design and/or architecture
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GraphQL specification violation in how Juniper handled field error propagation inside of fragment spreads
1 participant