v12.0,how use GraphQLServletContext?
NoBugBoy opened this issue · 3 comments
NoBugBoy commented
getContext(); is deprecated, how can I retrieve HttpServletRequest from DataFetchingEnvironment?
NoBugBoy commented
in Instrumentation can not use RequestContextHolder.getRequestAttributes();
Deleted user commented
We are facing the same issue. We have a central microservice to get specific data from the http request header and this is now not possible anymore. In the Datafeching-Environment is not working there, because there is no specific graphql operation
oliemansm commented
As you've noticed v12 does not support environment.getGraphQLContext() yet. Support has been added to v13.0.0. You can retrieve the request from the context as follows:
HttpServletRequest httpServletRequest = environment.getGraphQlContext().get(HttpServletRequest.class);