graphql-spring-boot icon indicating copy to clipboard operation
graphql-spring-boot copied to clipboard

Cannot log response using OncePerRequestFilter

Open pinguinjkeke opened this issue 2 years ago • 0 comments

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 return false 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.

pinguinjkeke avatar Aug 13 '21 11:08 pinguinjkeke