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
-
We've been working with
debugInfo
in 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 theGraphQLError
from thegraphql-dgs-client
this is not possible to retrieve. Here theGraphQLError
is a Kotlin data class withextensions
, thoseextensions
containdebugInfo
, 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
: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
variables
part of theGraphQLErrorDebugInfo
but 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