Patrick S.
03/29/2023, 4:42 PMgraphql.GraphQLError
which contains the extension in the error response.
So far we have tried
1. Extend the Spring DataFetcherExceptionResolverAdapter
however this bean is not directly related to kotlin-graphql and thus has no effect.
(Followed this approach https://www.baeldung.com/spring-graphql-error-handling#2-graphql-response-with-handled-exception)
2. Tried to hook into com.expediagroup.graphql.generator.federation.exception.FederatedRequestFailure
but I do not find the option to replace the RequestFailure —> ErrorCode mapping with a custom implementation.
3. Tried to understand KotlinDataFetcherFactoryProvider
(link) as the docs make it sound like it may be possible to modify fetchers. Here I can’t find anything concerning exception handling though.
Any advice on how set the error extension values is much appreciated! Keep up the amazing work!
(I also can ask this question on StackOverflow to ensure long-term findability)Dariusz Kuc
03/29/2023, 7:03 PMgraphql-java
graphql.GraphQLError
then exception will be returned as-is without the need for any transformationDariusz Kuc
03/29/2023, 7:47 PMgraphql.execution.DataFetcherExceptionHandler
that could map your exceptions to GraphQLError
(your bean will override the default one -> https://github.com/ExpediaGroup/graphql-kotlin/blob/master/servers/graphql-kotlin-[…]diagroup/graphql/server/spring/GraphQLExecutionConfiguration.kt)Patrick S.
03/29/2023, 8:35 PMDariusz Kuc
03/29/2023, 8:37 PM