Netflix / dgs-framework

GraphQL for Java with Spring Boot made easy.
https://netflix.github.io/dgs
Apache License 2.0
3.03k stars 286 forks source link

bug: "path" is not mapped from DataFetchingException to TypedGraphQLError #1909

Closed njuro closed 1 month ago

njuro commented 1 month ago

Hi, in version 8.6.0, GraphQLJavaErrorInstrumentation was introduced which maps exceptions to TypedGraphqlError. However in the case of DataFetchingException when the error builder is used, the path parameter is not mapped and that information is therefore lost.

Expected behavior

The mapped TypedGraphqlError should contain path if the original exception contained path.

Actual behavior

The mapped TypedGraphqlError does not contain any path.

Steps to reproduce

Throw data fetching exception and let the instrumentation math it to GQL error

Note: A test case would be highly appreciated, but we understand that's not always possible

srinivasankavitha commented 1 month ago

Thanks for flagging. Fixed in #1910