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
In this tutorial, there is a part where we use GraphQL Modules to build the currentUser context. The recommendation is to create a AuthModule and import it in every module we need to authenticate the user. But... there is a problem.
Every time we import a module into another module, the context is built. So, if we are making DB queries, we're going to make 3, 4, 5, db calls in every request.
A workaround is to create a service using ProviderScope.Session and store the user data in the class property and use it if exists. Is this the expected behavior?
The text was updated successfully, but these errors were encountered:
Yes, you're right. Context was built async for each module recursively before. But now we changed it and it is done using a sync iteration.
And for your case, it must be fixed in the latest version. Could you check and let me know if it works correctly.
In this tutorial, there is a part where we use GraphQL Modules to build the
currentUser
context. The recommendation is to create aAuthModule
and import it in every module we need to authenticate the user. But... there is a problem.Every time we import a module into another module, the context is built. So, if we are making DB queries, we're going to make 3, 4, 5, db calls in every request.
A workaround is to create a service using
ProviderScope.Session
and store the user data in the class property and use it if exists. Is this the expected behavior?The text was updated successfully, but these errors were encountered: