Perform deep mutations at multiple levels. Deep mutations donβt alter linked objects, but add nested new objects or link to existing objects.
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.
You can perform deep mutations at multiple levels. Deep mutations donβt alter linked objects, but they can add deeply nested new objects or link to existing objects. To update an existing nested object, use the update mutation for its type.
We use the following schema to demonstrate some examples.
Variables:
The following example assumes that the post with the postID of 0x456
already
exists, and isnβt currently nested under the author having the id of 0x123
.
This syntax doesnβt remove any other existing posts, it just adds the existing post to any that may already be nested.
Variables:
This example query canβt modify the existing postβs title or text. To modify the
postβs title or text, use the updatePost
mutation either alongside the this
mutation, or as a separate transaction.