You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Our application uses a custom error presenter to retrieve and log supplemental information annotated on errors in application code or through GraphQL directives using error wrappers, e.g. errors.WithMessage https://pkg.go.dev/github.com/pkg/errors#WithMessage
Because the error passed to the error presenter is first processed with ErrorOnPath
What happened?
Any errors wrapped around an instance of
*gqlerror.Error
will be discarded whengraphql.ErrorOnPath
is called because of this block:gqlgen/graphql/error.go
Lines 25 to 29 in fb13091
Our application uses a custom error presenter to retrieve and log supplemental information annotated on errors in application code or through GraphQL directives using error wrappers, e.g. errors.WithMessage
https://pkg.go.dev/github.com/pkg/errors#WithMessage
Because the error passed to the error presenter is first processed with
ErrorOnPath
gqlgen/graphql/context_response.go
Line 48 in fb13091
we will lose any annotated information wrapped around the original
*gqlerror.Error
since the error wrappers have been discarded.See a minimal example to reproduce in a golang playground:
https://go.dev/play/p/TzCt0-D-LRU
yields
What did you expect?
The above code snippet should instead output
Minimal graphql.schema and models to reproduce
No schema/model needed. See reproduction:
https://go.dev/play/p/TzCt0-D-LRU
versions
go run github.com/99designs/gqlgen version
? Any version at 0.13.0 or above since it includes this commitgo version
? Any go versionThe text was updated successfully, but these errors were encountered: