Update Mutations
Update mutations let you to update existing objects of a particular type. With update mutations, you can filter nodes and set or remove any field belonging to a type.
We’re overhauling Dgraph’s docs to make them clearer and more approachable. If you notice any issues during this transition or have suggestions, please let us know.
Update mutations let you update existing objects of a particular type. With update mutations, you can filter nodes and set or remove any field belonging to a type.
We use the following schema to demonstrate some examples.
Schema:
Dgraph automatically generates input and return types in the schema for the
update
mutation. Update mutations take filter
as an input to select specific
objects. You can specify set
and remove
operations on fields belonging to
the filtered objects. It returns the state of the objects after updating.
Executing an empty remove {}
or an empty set{}
doesn’t have any effect on
the update mutation.
Set
For example, an update set
mutation using variables:
Variables:
Remove
For example an update remove
mutation using variables:
Variables:
Examples
You can refer to the following link for more examples.
Was this page helpful?