Add DataFetcherExceptionResolverAdapter
The adapter aims to: - simplify the common case of synchronous resolution to a single error - support ThreadLocal context propagation on an opt-in basis This replaces the SyncDataFetcherExceptionResolver and removes the need to propagate ThreadLocal context to every resolver.
This commit is contained in:
@@ -271,6 +271,11 @@ by the <<execution-graphqlsource>> builder. It enables applications to register
|
||||
more Spring `DataFetcherExceptionResolver` components that are invoked sequentially
|
||||
until one resolves the `Exception` to a list of `graphql.GraphQLError` objects.
|
||||
|
||||
`DataFetcherExceptionResolver` is an asynchronous contract. For most implementations, it
|
||||
would be sufficient to extend `DataFetcherExceptionResolverAdapter` and override
|
||||
one of its `resolveToSingleError` or `resolveToMultipleErrors` methods that
|
||||
resolve exceptions synchronously.
|
||||
|
||||
A `GraphQLError` can be assigned an `graphql.ErrorClassification`. Spring GraphQL
|
||||
defines an `ErrorType` enum with common, error classification categories:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user