Interface DataFetcherExceptionResolver


public interface DataFetcherExceptionResolver

Turns an exception a resolver threw into the errors the response reports, as Spring for GraphQL's interface of the same name does (synchronously: there is no reactive type here).

Register one with GraphQL.Builder.exceptionResolver(DataFetcherExceptionResolver); @GraphQlExceptionHandler methods compile to one. Resolvers are asked in the order registered, after the failing controller's own handlers.

  • Method Details

    • resolveException

      List<GraphQLError> resolveException(Throwable exception, DataFetchingEnvironment environment)
      The errors for exception, or null to let the next resolver -- and finally the built-in mapping -- answer. An empty list reports no error, and the field is null.