upsert{
query{
v as var(func: type(Tag)) @cascade {
c as count(~tags)
}
B as q(func: uid(c)) @filter(eq(val(c),0))
}
mutation @if(eq(len(B), 0) ){
delete{
uid(v) * * .
}
}
}
upsert{
query{
v as q1(func: type(Tag)) @cascade {
c as count(~tags)
}
b as q2(func: uid(v)) @filter(eq(val(c),0))
}
mutation{
delete{
uid(b) * * .
}
}
}