I’m trying to write a query that gets me all common descendants of uids in a query variable
I only got as far as
# TODO match each ANCESTOR_QUERIED_BLOCKS uid, not any
e(func: uid(ANCESTOR_QUERIED_BLOCKS)) @recurse(depth: 1000) {
DESCENDANTS as uid
name
relation
}
which returns all descendants of all ANCESTOR_QUERIED_BLOCKS, but I want the ones that are a descendant of every uid in ANCESTOR_QUERIED_BLOCKS.
I don’t think that there is a direct way to achieve this. What I can suggest you, is to fetch the descendants for each UID and then process the result in the client side to find the ones that are descendant of every uid in ANCESTOR_QUERIED_BLOCKS.
Tagging @MichelDiz, if he has some direct approach.
Could be any amount. It’s a variable I get from another part of the query.
Thanks! Will consider this, as well as doing 2 queries (query 1 as op, query 2 built something like @Anurag’s answer on the client), and do some perf testing on that