Skip to content
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

add context in generateDataLoader to configure the query based on req #11

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

gouroujo
Copy link

@gouroujo gouroujo commented Feb 7, 2020

This PR will allow to configure how we resolve data based not only on a list of ids but also with the current graphql context.

@asmeikal
Copy link

@gouroujo I was about to make the same PR! 😃 I was looking for a way to pass an access token from the request to a gRPC dataloader, and I settled for this solution. I think typing the context passed to generateDataLoader as GraphQLExecutionContext would be safer.

@krislefeber this shouldn't be breaking, existing data loaders can ignore the parameter and keep working as expected, even without overloading the generateDataLoader method.

@krislefeber
Copy link
Owner

@gouroujo, if we can get typing added to the passed in context variable I will go ahead and make the merge. I see my mistake about the optional parameter

@ghost
Copy link

ghost commented Sep 3, 2020

Is there any plan to merge this? It would be a great addition to this lib.

The alternative for me is to fork this repo and do it in my project but I would love to keep using this package 😄

chrisbucholz added a commit to nucleuslabs/nestjs-dataloader that referenced this pull request Dec 16, 2020
@AmrAnwar
Copy link

Is there any update regarding this ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants