I can’t get to the level of detail because I didn’t create that code and its algorithm. But I know that it recursively applies everything in the body and can end up influencing other edges that have some relationship.
But this is normal, recurse is a type of query that can generate unexpected results. You shouldn’t use recurse as a source of truth. But to explore its objects. Don’t do fancy things with it. Always create predictable queries. Or you will have problems.
An example of problems with recurse in the real world would be “rm” on unix-like systems. It can be problematic if you use “-r” for example “rm -fr *” this can be catastrophic. So we never use recurse on sensitive things.
Always make predictable patterns. And use non-predictable patterns just for exploration. IMHO.
It does. Not sure it doesn’t for you.
Run this query
{
q(func: eq(dgraph.type, "Person"), first:100 ) @recurse(depth:10)
@filter(NOT
( eq(name, "Alice")
or eq(name, "Bob")
or eq(name, "Charlie")
or eq(name, "Dave")
or eq(name, "Raj")
))
{
name
dgraph.type
age
owns_pet
friend~
friend
count(friend)
}
}
in Dgraph Ratel Dashboard - You will see that the filter used on the Root query(root params) will be applied.