How to create/get a bean of DataFetchingEnvironment with RequestScope? #438
Replies: 3 comments 2 replies
-
I have the exact same issue, would like to access request information in a layered architecture, without having to pass it from the resolver through each method, maybe by injecting it through some bean in the level i want, is that possible? |
Beta Was this translation helpful? Give feedback.
-
@danielborges93 @aymanmoukhtar : I haven't tested it, but have you tried creating a bean with Session scope and manipulate/set the POJO variables at the base query level (once), based on DataFetchingEnvironment and inject it wherever else you need? That should provide you exactly what you need. |
Beta Was this translation helpful? Give feedback.
-
@danielborges93 @aymanmoukhtar |
Beta Was this translation helpful? Give feedback.
-
I want to get a instance of
DataFetchingEnvironment
per scope as a bean in my code.My motivation is to get the request authorization header per each request without passing the
DataFetchingEnvironment
as a resolver method param. What is the best way to do this?Thanks!
Beta Was this translation helpful? Give feedback.
All reactions