For example, I have some device with owner:
type Device {
uuid: String! @id @search(by: [hash])
owner: User! @hasInverse(field: devices)
}
type User {
uuid: String! @id @search(by: [hash])
devices: [Device] @hasInverse(field: owner)
}
query {
queryDevice {
uuid
owner {
uuid
}
}
}
{
"data": {
"queryDevice": [
{
"uuid": "foo",
"owner": {
"uuid": "bar"
}
}
]
}
I make some mutation and get the result:
mutation {
updateDevice(input: {
filter: { uuid: { eq: "foo" }},
set: { owner: { uuid: "baz" } }
}) {
device {
uuid
owner {
uuid
}
}
}
}
{
"data": {
"updateDevice": {
"device": [
{
"uuid": "foo",
"owner": {
"uuid": "baz"
}
}
]
}
}
}
Then I want to return back old owner, but mutation doesn’t change it:
mutation {
updateDevice(input: {
filter: { uuid: { eq: "foo" }},
set: { owner: { uuid: "bar" } }
}) {
device {
uuid
owner {
uuid
}
}
}
}
{
"data": {
"updateDevice": {
"device": [
{
"uuid": "foo",
"owner": {
"uuid": "baz"
}
}
]
}
}
}
Am I doing something wrong?