Filtering http responses in graphql #29232
-
Is there an option to add filter that will handle http responses using filters? For example, I want to log information about response(status code, returned entity, etc.) but I don't get how can I make @RouteFilter to be called after response because priority sets subsequence only for filters that will be called before controller method call and I need this filter to be called after controller method. Usage of @ServerResponseFilter and @ServerRequestFilter wasn't succesfull. Application just didn't see these filters at all... |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
/cc @jmartisk, @phillip-kruger |
Beta Was this translation helpful? Give feedback.
-
GraphQL does not use Servlets or JAX-RS, but run directly on Vert.x HTTP. So whatever you can do with Vert.x should work. You can also use CDI Interceptor, but that will be per operation, and not the full execution. If you just want to see the payload in and out, you can also use the log-payload config option: https://quarkus.io/guides/smallrye-graphql#quarkus-smallrye-graphql_quarkus.smallrye-graphql.log-payload |
Beta Was this translation helpful? Give feedback.
GraphQL does not use Servlets or JAX-RS, but run directly on Vert.x HTTP. So whatever you can do with Vert.x should work. You can also use CDI Interceptor, but that will be per operation, and not the full execution.
If you just want to see the payload in and out, you can also use the log-payload config option: https://quarkus.io/guides/smallrye-graphql#quarkus-smallrye-graphql_quarkus.smallrye-graphql.log-payload