Open csuriano23 opened 2 years ago
You want to inject stuff into info.context
? if yes, when?
Yes, I want to inject an http client as a dependency in the info.context, but some client parameters depends on the request parameter (eg. the login user)
You can:
context_value
to Schema.execute
(after you got the request object..)maybe @Kludex has some ideas about this. In the django integration we have defined get_context
on the class and it receives the info param, I think we should have the same for fastapi
Why not having the HTTP client globally? 🤔
Why not having the HTTP client globally? 🤔
It would mean having a singleton per HTTP user session; I am not sure it really is the best thing
This is a great idea. I would suggest writing an extension that injects the fastapi dependency into the resolvers.
Hello, is there a way to define a parametric dependency injection based on some of the query/mutation variables?
Eg. something like
Upvote & Fund