Thanks for the suggestions @mandolyte.
How does this format look? @mrjn
# To traverse the friends and relatives edges
# completely and get all their names.
{
recurse(id: <start>) {
friend
relative
name # This is a leaf node.
}
}
# To traverse the predicates 10 times
# and get their names.
{
recurse(id: <start>, depth: 10) {
has
name
}
}
We will avoid visiting the same node twice.
And will return the entire subtree as the result.
An implementation: Support recursive queries by ashwin95r · Pull Request #647 · dgraph-io/dgraph · GitHub