[Answered ]-Filter at multiple levels with GraphQL and Graphene

2👍

This is a bug in graphene-django. It was fixed in version 1.3.
Changelog

Regards.

0👍

I’m not sure if the same person asked the question on graphene github page, but it looks almost, if not exactly the same. Apart from the fact mentioned bug existed, you still need some improvement in your code.

In order to make it work as you described (getting only related JobDetail for each Job) you have to define a resolver inside JobNode:

def resolve_job_details(self, args, context, info):
    return JobDetail.objects.filter(job=self, **args)

Of course you need also Job resolver inside PushNode:

def resolve_jobs(self, args, context, info):
    return Job.objects.filter(push=self, **args)
👤Jacu

Leave a comment