I have two types of Nodes, Categories and Products - and Categories can have related subcategories (which are themselves Categories).
I’m trying to query root Categories (categories without any parent category), each with a list of communities representing all the communities related to any subcategory of that root category.
Using @recurse gives me a nested result, (Category → Subcategory → [Communities]) - but I’m looking to return a flattened list (Category → [Communities])
Normalize as above will return a category object with a normalized subcategory field. I’m looking to return a community field with a list of any community related to any subcategory - if that makes sense.
I’d like to traverse the graph until all subcategories (and subcategories of subcategories) are traversed.
The problem is that Product #2 is related the a subcategory of Category #2, which are being filtered out by @filter(NOT has(Category.parent_categories))
Weird. So why this appears in the response? it should be filtered out. The category itself should be excluded if it has Category.parent_categories predicate.
The params at the query root are applied only in the root objects. The nested ones follows the rules in the query body.