Replies: 1 comment
-
| I think this question is mixing two different concerns. First, extracting information from the transport layer (here, WebFlux HTTP) and sharing it with the GraphQL request handling. Spring for GraphQL has a dedicated interceptor mechanism that allows you to extract information from the HTTP request and share it with the  The second part is about propagating context information between the  Now looking at your question, it's not clear whether your project is using Spring for GraphQL, DGS, or something custom entirely. In any case, I would argue that this is not a grpahql-java concern but more a problem to be solved by the framework integrating graphql-java in the application. | 
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm developing a library on graphql-java that exposes a Custom Instrumentation class for the users to adopt. I'm facing challenges while extending its support to the Webflux Apps. I have a use case where I need to extract the headers from the incoming request and that needs to be populated in the Instrumentation State that we create.
To be able to achieve this, I've created a filter as follows-
Also, I've created a Context Holder as follows-
Now, when I'm trying to extract this ServletHttpRequest in createState method of the custom instrumentation class, I'm not able to do so. Like neither I'm unable to extract the request from the reactive context, nor I'm able to do any operation on it (with .map or .flatMap) in the reactive context as well, it just says
Context is empty.Although, when I'm trying this piece of code with DGS Webflux Applications, it enriches the context successfully, and DGS has its own way of extracting the request out of the Reactive Context (so, we don't really need a ReactiveRequestContextHolder there). Just want to know whether this is achievable with graphql-java as well, if yes please help me with this. Thanks!
Beta Was this translation helpful? Give feedback.
All reactions