How to combine the query with the Mutate

What I saw from the Dgraph Manaul(https://docs.dgraph.io/mutations/#delete) is that I have to know the exact uid for the nodes, then I can delete them one by one.

I’m wondering if there is a way to do it without geting to know the exact uid and more easier like below:

{
  IDs as var(func: has(<somePredicate>)) {
  }
  delete {
    IDs * * .
  }
}

For now, you can’t combine mutation with query. You have to open an transaction, query and then mutate with what comes from that query. Commit, and then discard the transaction.

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.