Debug information in GraphQL errors #1599
Unanswered
martinvisser
asked this question in
Q&A
Replies: 1 comment
-
|
As far as I recall, the Created an issue to track this: #1600 We do accept contributions, so feel free to open a PR as well if this is urgent for you since we won't be able to prioritize this issue anytime soon. |
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
Uh oh!
There was an error while loading. Please reload this page.
-
We've been working with
debugInfoin our set-up and want to add some extra information to an error, which is perfectly simple with the following piece of code:In other words, you can just add trivial information to
debugInfo, because it's aMap<String, Object>. However, in theGraphQLErrorfrom thegraphql-dgs-clientthis is not possible to retrieve. Here theGraphQLErroris a Kotlin data class withextensions, thoseextensionscontaindebugInfo, but that's of typeGraphQLErrorDebugInfo:So here it's no longer a
Map<String, Object>but the object above and therefore not usable with the same flexibility.A simple example, generated with the
TypedGraphQLError:{ "errors": [ { "message": "Something went wrong", "locations": [], "extensions": { "errorType": "UNAVAILABLE", "origin": "the internet", "errorDetail": "SERVICE_ERROR", "debugInfo": { "code: "HTTP_418", "message": "I'm a teapot", "details": "Some details", "service": "CoffeeService", } } } ], "data": {..} }Results in the following if used with the DGS client:

GraphQLError(message=Something went wrong, path=[], locations=[], extensions=GraphQLErrorExtensions(errorType=UNAVAILABLE, errorDetail=SERVICE_ERROR, origin=the internet, debugInfo=GraphQLErrorDebugInfo(subquery=, variables={}), classification=))Technically we could use the
variablespart of theGraphQLErrorDebugInfobut that feels incorrect. Is there another way we can expose this same information when using the DGS client? If not, perhaps this implementation can be updated to accommodate this?Beta Was this translation helpful? Give feedback.
All reactions