-
Notifications
You must be signed in to change notification settings - Fork 110
Closed
Description
Hello,
I am currently working on a project where I use the Apollo Federation Gateway and graphene-federation to connect multiple Microservices. For each external Type I need to add the following resolver to the type.
def __resolve_reference(self, info, **kwargs):
return MY_MODEL.objects.get(id=self.id)Couldn't we just add something like the following to the MongoEngineObjectType?
@classmethod
def __resolve_reference(cls, info):
return cls._meta.model.objects.get(id=self.id)The only problem is that we need to resolve the reference by the Types key which isn't alwasy the id (just in my case). It could be any property of the model.
Thanks!