We have a use case where we want to upsert entries but in the case of an update, the row is only affected if it meets a certain condition, e.g. the timestamp of the new data is greater than the timestamp of the old.
An example query might look like:
mutation {
insert_item(
objects: {itemId:"1234", creationEpochSeconds: 1567026834},
on_conflict: {
constraint: item_pkey,
update_columns: [itemId, creationEpochSeconds]
where: {creationEpochSeconds: {_lt: 1567026834 }}
}) {
affected_rows
}
}