You can do an upsert as far as getting the ID (but not @id type) of a node and updating it based on that id. See here.
However, it looks like you’re trying to change the nodes based on their current values, which cannot be done in GraphQL, as you do need to save the var somewhere.
Either do it on the client side, or use a lambda mutation or a lambda webhook with dql, as those are currently your only two options.
Thank you. I am trying to implement a Like counter on a Post and worry that doing it on the client side might not result in accurate count if multiple users are liking the post.
I will look into lambda option in the hope that I can get ACID transactions from that.