Annotation Interface GraphQlExceptionHandler
Declares a method as a handler of exceptions raised while fetching data
for a field. When declared in an
@Controller
, it applies to
@SchemaMapping
methods of that controller only. When declared in an
@ControllerAdvice
it applies across controllers.
You can also use annotated exception handler methods in
@ControllerAdvice
beans to handle exceptions from non-controller
DataFetcher
s by obtaining
AnnotatedControllerDetectionSupport.getExceptionResolver()
and registering it with
GraphQlSource.Builder
.
Supported return types are listed in the Spring for GraphQL reference documentation in the section "Annotated Controllers".
- Since:
- 1.2.0
- Author:
- Rossen Stoyanchev
-
Optional Element Summary
-
Element Details
-
value
Exceptions handled by the annotated method. If empty, defaults to exception types declared in the method signature.- Default:
- {}
-