Open
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #610 +/- ##
==========================================
+ Coverage 84.00% 84.09% +0.08%
==========================================
Files 152 151 -1
Lines 4978 4999 +21
Branches 861 861
==========================================
+ Hits 4182 4204 +22
Misses 495 495
+ Partials 301 300 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Adds support for proper error handling and partial responses as defined by the spec, cf. https://spec.graphql.org/September2025/#sec-Errors KGraphQL now distinguishes between _request_ and _execution_ errors, and the latter now result in a response that contains both, `data` and `errors`. Execution errors result in a value of `null` for nullable fields, and will bubble up to their parent node for non-nullable fields. Additionally, resolvers can now raise execution errors while still returning data. If data _and_ errors are present in the response, the `errors` key is serialized first to make it more apparent that errors are present. Behavior for request errors is unchanged, and `wrapErrors` configuration is still supported for now - but likely subject to change in the future. Resolves #114 BREAKING CHANGE: relying on exceptions being thrown from query execution may no longer work as before. It is advised to specify `wrapErrors = false` and report an issue with the respective use case.
acea407 to
c70d308
Compare
Owner
Author
Owner
Author
|
@grumpy-programmer Sorry, this took way longer than anticipated but - following our conversation in #437 - if you're still interested in discussing error handling then I'd be happy to receive your thoughts here and in the linked pull requests 🙂 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds support for proper error handling and partial responses as defined by the spec, cf. https://spec.graphql.org/September2025/#sec-Errors
KGraphQL now distinguishes between request and execution errors, and the latter now result in a response that contains both,
dataanderrors. Execution errors result in a value ofnullfor nullable fields, and will bubble up to their parent node for non-nullable fields. Additionally, resolvers can now raise execution errors while still returning data.If data and errors are present in the response, the
errorskey is serialized first to make it more apparent that errors are present.Behavior for request errors is unchanged, and
wrapErrorsconfiguration is still supported for now - but likely subject to change in the future.Resolves #114
BREAKING CHANGE: relying on exceptions being thrown from query execution may no longer work as before. It is advised to specify
wrapErrors = falseand report an issue with the respective use case.