Currently there is no way to do this in Dgraph except manually. This includes dql and graphql.
I have proposed a Reference Directive which mimics SQL’s
ON DELETE CASCADE
ON UPDATE CASCADE
However, Dgraph has not shown any interest in adding this basic foreign key feature in the future.
For the moment, you can only emulate this with a delete
and update
Lambda Webhook. This is basically an After (add/delete/update) Trigger Function.
J