Class MyDataFetcherExceptionResolverAdapter

java.lang.Object
org.springframework.graphql.execution.DataFetcherExceptionResolverAdapter
org.forum.server.specific_code.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
  • Field Summary

    Fields inherited from class org.springframework.graphql.execution.DataFetcherExceptionResolverAdapter

    logger
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected graphql.GraphQLError
    resolveToSingleError(Throwable ex, graphql.schema.DataFetchingEnvironment env)
     

    Methods inherited from class org.springframework.graphql.execution.DataFetcherExceptionResolverAdapter

    isThreadLocalContextAware, resolveException, resolveToMultipleErrors, setThreadLocalContextAware

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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