graphql-spring-boot
graphql-spring-boot copied to clipboard
Cannot log response using OncePerRequestFilter
Describe the bug We need to log all JSON request and responses in graphQL servlet.
Spring version: 5.3.9 Kickstart version: 11.1.0
To Reproduce Steps to reproduce the behavior:
- Create class extending spring's
OncePerRequestFilter
- Optional: tried to replace
shouldNotFilterAsyncDispatch
method to returnfalse
value - Observe that empty response is logged even if it's not empty
Expected behavior Be able to read response data and log it
Additional context
Also tried to use GraphQLServlet listener onSuccess
and onFinally
methods, but response is already committed at that time so I can't log it.