I have a graphene subscription object type defined with the following resolver (resolve_area_by_dc). I need to create multiple subscription resolvers for different model types (this one is for AreaModel). The only thing that needs to be different between the resolvers are the model types -- as such, I'm trying to make my code as DRY as possible by having a single resolver function that parameterizes the model type.
Unfortunately, when I try to do so, it doesn't work, and so I'm probably not understanding how the callbacks actually work..
I have a graphene subscription object type defined with the following resolver (
resolve_area_by_dc
). I need to create multiple subscription resolvers for different model types (this one is for AreaModel). The only thing that needs to be different between the resolvers are the model types -- as such, I'm trying to make my code as DRY as possible by having a single resolver function that parameterizes the model type.Unfortunately, when I try to do so, it doesn't work, and so I'm probably not understanding how the callbacks actually work..
This is what I'm trying:
If I replace
resolve_area_by_dc
with this, it works: