Or condtion between 2 different node filters (anti join)

This is exactly the work around we implemented in our app for the time being. We allow users to build these complex filters dynamically so it was tricky getting all of this working to give users a list of filter options to dynamically build the queries and then combining multiple lists of ids logically into a single set of ids.

To get a list of ids from a deeply nested query give this function a try:

I modified it slightly in my actual production since Apollo Client auto adds the __typename to every node.

FYI, for a better performance run all of the queries to get these filtered ids in one operation.

I put many, many, many! hours into getting all of this to work well, so I probably will not share this code publicly as it is largely the crux of our app’s upperhand on other apps filtering data with GraphQL in Dgraph. I plan to showcase this filter builder part of our app in the upcoming Dgraph Day.