public interface SyncDataFetcherExceptionResolver extends DataFetcherExceptionResolver
DataFetcherExceptionResolver
that resolves exceptions synchronously.Modifier and Type | Method and Description |
---|---|
List<GraphQLError> |
doResolveException(Throwable exception,
DataFetchingEnvironment env)
Implement this method to resolve exceptions.
|
default reactor.core.publisher.Mono<List<GraphQLError>> |
resolveException(Throwable exception,
DataFetchingEnvironment env)
Resolve the given exception and return the error(s) to add to the response.
|
default reactor.core.publisher.Mono<List<GraphQLError>> resolveException(Throwable exception, DataFetchingEnvironment env)
DataFetcherExceptionResolver
Implementations can use
GraphqlErrorBuilder.newError(DataFetchingEnvironment)
to create an
error with the coordinates of the target field, and use ErrorType
to
specify a category for the error.
resolveException
in interface DataFetcherExceptionResolver
exception
- the exception to resolveenv
- the environment for the invoked DataFetcher
Mono
with errors to add to the GraphQL response; if the
Mono
completes with an empty List, the exception is resolved without any
errors added to the response; if the Mono
completes empty, without emitting
a List, the exception remains unresolved and gives other resolvers a chance.List<GraphQLError> doResolveException(Throwable exception, DataFetchingEnvironment env)
exception
- the exception to resolveenv
- the environment for the invoked DataFetcher