engine
engine copied to clipboard
Feature request: `set` on related collections
When you need data to end up exactly as you specify, without the need to get all the old previous ids and manually delete them.
Probably needed something like orphanStrategy
to choose if old data are to be deleted or just disconnected.
# current
mutation {
updateThing(
by: { id: "foobar" }
data: {
relatedThings: [{ delete: { id: "1" } }, { create: { foo: "bar" } }]
}
)
}
# possibilities
mutation {
updateThing(
by: { id: "foobar" }
data: {
relatedThings: {
orphanStrategy: "delete"
set: [{ create: { foo: "bar" } }]
}
}
)
}
mutation {
updateThing(
by: { id: "foobar" }
data: {
relatedThings: {
orphanStrategy: "disconnect"
set: [{ create: { foo: "bar" } }]
}
}
)
}
related to #60