Search for objects by predicate and subject

I wonder if there is a way to search for objects that have a certain relationship to other objects:
First …

mutation{
  set{
    <a> <name> "A" .
    <b> <name> "B" .
    <a> <relatesTo> <b>
   }
}

… then …

incoming(func: ???(relatesTo,b){
 name
}

would yield

{"incoming":[{"id":a,"name":"A"}]

(-ish)

That way we could actually search for relationships, not having to rely to add reverse indexes to all relationships we want to backtrack. (This could partly be solved if all also would return reverse indexes)
It would make life a lot easier when cleaning up data when deleting.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.