I'm using Apollo Client with (hasura as backend if that matters) and have the following mutation:
mutation SetArbitrarySubset(
$id: String!
$foo: String
$bar: String
) {
update_table(
where: { id: { _eq: $id } }
_set: {
foo: $foo
bar: $bar
}
) {
affected_rows
}
}
if i won't set foo or bar the mutation results in setting unset variables to null in the DB is there any way to preserve the previous entry without writing permutations for each case?