Spring Boot GraphQL Tutorial #9 - Exception Handling with GraphQLErrorHandler

Опубликовано: 21 Октябрь 2024
на канале: Philip Starritt
10,436
66

In the previous video I explained how to use Spring web's @ExceptionHandler annotations with GraphQL. In this example I create a custom GraphQLErrorHandler which can be used instead of the default error handler & exception handlers.

If you create a bean of type GraphQLErrorHandler, then graphql will ignore the graphql.servlet.exception-handlers-enabled property and annotated methods. This is because the @ExceptionHandler logic is called from the DefaultGraphQLErrorHandler, a class that is no longer used.

See you in the next video. Spring Boot GraphQL DataFetchingResult.

Cheers!
Philip

GraphQL Spring Boot: https://github.com/graphql-java-kicks...


Thumbnail Image from:   / javascript-error-handling