You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Hope this is right place I can put to raise this issue, I defined a graphql query to fetch users, and there is a UserDataLoader which is request scoped bean injected into UserDataFetcher, I encounter an below error when execute a graphql http request:
11:00:34.302 [pool-4-thread-1] ERROR graphql.kickstart.execution.error.DefaultGraphQLErrorHandler - Error executing query Exception while fetching data (/users[1]/user) : Error creating bean with name 'scopedTarget.userDataLoader': Scope 'request' is not active for the current thread; consider defining a scoped proxy for this bean if you intend to refer to it from a singleton
java.lang.IllegalStateException: No thread-bound request found: Are you referring to request attributes outside of an actual web request, or processing a request outside of the originally receiving thread? If you are actually operating within a web request and still receive this message, your code is probably running outside of DispatcherServlet: In this case, use RequestContextListener or RequestContextFilter to expose the current request.
at org.springframework.web.context.request.RequestContextHolder.currentRequestAttributes(RequestContextHolder.java:131) ~[spring-web-6.1.8.jar:6.1.8]
at org.springframework.web.context.request.AbstractRequestAttributesScope.get(AbstractRequestAttributesScope.java:42) ~[spring-web-6.1.8.jar:6.1.8]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:373) ~[spring-beans-6.1.8.jar:6.1.8]
... 50 more
Wrapped by: org.springframework.beans.factory.support.ScopeNotActiveException: Error creating bean with name 'scopedTarget.userDataLoader': Scope 'request' is not active for the current thread; consider defining a scoped proxy for this bean if you intend to refer to it from a singleton
Describe the bug
Hope this is right place I can put to raise this issue, I defined a graphql query to fetch users, and there is a UserDataLoader which is request scoped bean injected into UserDataFetcher, I encounter an below error when execute a graphql http request:
To Reproduce
gradle configration:
UserDataFetcher :
UserDataLoader:
Expected behavior
No error
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: