Replies: 1 comment
-
We dont have a callback that allows you to adjust errors as they are created - but this callback would allow it in a whole of result sense |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, I want to standardize our service's graphql error handling by including a standard 'code' entry to extensions in error. It's easier to do for our code raised error with a customized error handler. But for non schema/parsing related error raised by graphql-java library code the customized error handle is not triggered. Is there a way to still intercept such error and add customization to the result?
One example is null for required input (ID!). graphql-java will throw NonNullableValueCoercedAsNullException during parsing validation. The response is like below. I want to add "code": "BAD_INPUT" to extensions.
{ "errors": [ { "message": "Variable 'input' has an invalid value: Field 'someField' has coerced Null value for NonNull type 'ID!'", "locations": [ { "line": 1, "column": 43 } ], "extensions": { "classification": "ValidationError" } } ] }
Beta Was this translation helpful? Give feedback.
All reactions