graphql-java-kickstart/graphql-spring-boot

v12.0,how use GraphQLServletContext?

NoBugBoy opened this issue · 3 comments

getContext(); is deprecated, how can I retrieve HttpServletRequest from DataFetchingEnvironment?

in Instrumentation can not use RequestContextHolder.getRequestAttributes();

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

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);