This repository was archived by the owner on Dec 19, 2023. It is now read-only.

Description
Describe the bug
The exception handling made with @ExceptionHandler annotated methods doesn't work if Spring beans are proxied with CGLIB (e.g. when Spring AOP is enabled). This is due to the implementation of ReflectiveMethodValidator.isGraphQLExceptionHandler(), which doesn't take care of the possibility that the given method belongs to a proxied subclass of the original class (and thus the method annotations are lost).
To Reproduce
Steps to reproduce the behavior:
- Set
graphql.servlet.exception-handlers-enabled to true
- Create a method annotated with
@ExceptionHandler inside a bean
- Enable AspectJ autoproxy on the Spring Application (using the specific annotation or just including an Aspect in the application context)
- The exception handler is ignored because the annotation is not available on the proxied class
Expected behavior
The exception handler should work even if AspectJ is enabled (that is, if the beans are proxied).