vektah / dataloaden

go generate based DataLoader
MIT License
530 stars 79 forks source link

Add context in the load function #36

Open guiajlopes opened 5 years ago

guiajlopes commented 5 years ago

Hi, I have some cases that I need the context... For example I'm using the library to make external requests to other APIs and each logged in user have their access key (which is in the context) and there's no way I can get it inside the fetch function.

My users are being set using GraphQL directives because some resolvers don't require users to be logged in

Can we add that?

edsrzf commented 5 years ago

Did you happen to see this part of the README? https://github.com/vektah/dataloaden#wait-how-do-i-use-context-with-this