After WEEKS of agonizing frustration with DGraph, I have finally found the holy grail of GraphQL+/- syntax that does what I need …
Attempt: OMG!
{
query: 'query {
parents(func:type("Parent")) @filter(eq(name,"Bob")) { parentUID as uid }
childrenUIDs as children(func:type("Child")) @cascade { parent @filter(uid(parentUID)) }
}',
delete: [{
'uid': 'uid(childrenUIDs)'
}, {
'uid': 'uid(parentUID)',
'children': 'uid(childrenUIDs)'
}]
}
This query removes both the relations of the chosen parent with their children as well as the children themselves.