Class MyDataFetcherExceptionResolverAdapter

java.lang.Object
org.springframework.graphql.execution.DataFetcherExceptionResolverAdapter
org.allGraphQLCases.server.config.MyDataFetcherExceptionResolverAdapter
All Implemented Interfaces:
org.springframework.graphql.execution.DataFetcherExceptionResolver

@Component public class MyDataFetcherExceptionResolverAdapter extends org.springframework.graphql.execution.DataFetcherExceptionResolverAdapter
A Spring bean that register DataFetcherExceptionResolverAdapter to configure the way Java exceptions are mapped to GraphQL errors.
This class is both a sample, and the support for an IT test that checks proper error management on client side, when an error occurs on server side.
Author:
etienne-sf
  • Constructor Details

    • MyDataFetcherExceptionResolverAdapter

      public MyDataFetcherExceptionResolverAdapter()
  • Method Details

    • resolveToSingleError

      protected graphql.GraphQLError resolveToSingleError(Throwable ex, graphql.schema.DataFetchingEnvironment env)
      Overrides:
      resolveToSingleError in class org.springframework.graphql.execution.DataFetcherExceptionResolverAdapter