How to delete with cascade?

Cascading deletes are not possible through a single GraphQL mutation but could be achieved through a DQL query for for your use-case.

Query:

{
  relations as me(func: eq(dgraph.type, "Relationship")) @filter(eq(name, "Child")) {
    rm as meta
  }
}

DeleteJSON:

[{
  "uid": "uid(relations)"
},
{
  "uid": "uid(rm)"
}]
2 Likes