-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Accessing graphql context from loader #28
Comments
I also require this functionality and would love to see the PR merged. It seems there is not too much activity in the repo lately 😢 Any ideas for alternatives? |
Is it null in both the constructor and in generateDataLoader()? It looks
like context is not readonly, which could prevent it from being an instance
variable. That's a javascript thing, not nestjs
…On Mon, Mar 1, 2021, 5:46 AM some-user123 ***@***.***> wrote:
I also require this functionality and would love to see the PR merged.
It seems there is not too much activity in the repo lately 😢
Any ideas for alternatives?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#28 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABTWSLADLHX3OAAE6V7TJKTTBN47XANCNFSM4NMGMAFA>
.
|
for everyone who still wants to fix it: you need to call https://docs.nestjs.com/fundamentals/module-ref#registering-request-provider |
It's undefined in both constructor and generateDataLoader. How can we create a DataLoader based on the context? This seems like a common use case. |
+1 looking to use values decoded from request headers into the actual data loader service call |
looks like this PR does the trick.. any way we can get this merged in? |
In loaders it is usually necessary to access the graphql execution context.
As per NestJS documentation I attempted to do it like this:
But
context
appears to beundefined
no matter what I do. I assume this is caused bynestjs-dataloader
somehow, because the nestjs documentation specifically mentions this use case.Alternatively, this would also seem to be fixed by #11
The text was updated successfully, but these errors were encountered: