I have strawberry setup to run with fastapi. Basically, like the examples, the fastapi initialization code creates a GraphQLRouter
with a Schema
object and a context_getter
.
Everything works great, I use __get_context
to pass some Depend
encies in.
What I don't know is, how do I conditionally call Depend
encies?
Like I might want a Depends(UserManager)
on some graphql calls and Depends(ClientManager)
on others. Normally in fast api, I could use different routers to assign different dependencies. But most of the strawberry fastapi examples use a single router for a single schema. Or more rarely multiple routers across multiple schemas.
How do I break up a strawberry GraphQL Schema
across multiple GraphQLRouter
s so I can use different Depend
s chains for different requests?