Found on branch releases/v20.11 commit hash: e1ee8595ec0d6d8e91a9292a4eb28738f1fbdd6c
schema
type Foo {
id: String! @id
bar: Bar! @hasInverse(field: foo)
}
type Bar {
id: String! @id
foo: Foo!
}
mutation
mutation {
addFoo(input: [
{
id: "1231"
bar: {
id: "12344"
foo: {id: "1231"}
}
}
]) {
numUids
}
}
Error: "message": "couldn't rewrite mutation addFoo because failed to rewrite mutation payload because duplicate XID found: 1231"
Solutions:
- Don’t allow a reference to foo when bar is added as a child of foo
or - Don’t throw this error and ignore the ID when it’s set to the same ID as the parent