for example:
<id>: string @index(exact) @upsert .
upsert {
query {
v as var(func: eq(id, "1"))
}
mutation {
set {
uid(v) <id> "1" .
uid(v) <name> "first node" .
}
}
}
upsert {
query {
v as var(func: eq(id, "2"))
}
mutation {
set {
uid(v) <id> "2" .
uid(v) <name> "second node" .
}
}
}
upsert {
query {
v as var(func: eq(id, "2"))
}
mutation {
set {
uid(v) <id> "1" .
uid(v) <name> "second node" .
}
}
}
then I got two nodes with same id, one name “first node”, another name “second node”.