Seems like this is working fine on ratel. I will have another look at the code level.
This is how I am doing this in python.
def delete_grouping(group_or_branch_uid: str) -> tuple:
print(group_or_branch_uid, "deleting queryyyyyyyyy")
query = """
upsert {
query {
a as q(func: uid($a)) @recurse {
uid
b as branches
c as child_groups
}
}
mutation {
delete {
uid(a) * * .
uid(b) * * .
uid(c) * * .
}
}
}
"""
def delete_query(_q: str, _vars: dict):
txn = client.txn(read_only=False)
try:
txn.async_query(_q, _vars)
txn.commit()
finally:
txn.discard()
return delete_query, query, {"$a": group_or_branch_uid}