Understanding Dgraph mutation

Hello,

Not sure if this is the good topic category, hope it’s good.

I had build the following graph:

BP -- p --> Actions -- p --> delete -- p --> step
BP -- p --> Actions -- p --> stop
BP -- p --> Notifications -- p --> delete -- p --> step

BP <-- d -- Notifications <-- d -- delete <-- d -- step
BP <-- d -- Actions <-- d -- delete <-- d -- step

I would like to understand how to get the UID of the “delete” node from “Actions” branch in order to add a new substep to it (as var query).

Ex:

upsert {
        query {
          Delete as var(**func: eq(action_name, \"delete\"))**
        }

        mutation {
          set {
            _:step<step_name> \"${step}\" .
            _:step<dgraph.type> \"Step\" .

            uid(Delete) <provides> _:step.
            _:step<depends> uid(Delete) .
          }
        }

Hope, i’m clear and the answer could helps others. In advance, thanks for your time !

Replying to myself, in case of it helps somebody else.

{
 me(func: eq(action_name,"delete")) @cascade { 
  action_name
  depends @filter (eq(name,"Actions"))
 }
}

Hi @maubertin

Thank you for your contributions! This is great. Sorry no one from the staff responded in time.

As you’ve noticed you do not need the UIDs… you can just use @filter. Great find!