I'm trying to send all my locally cached mutations to the server on user request. The idea is that there's a "Save Changes" button in the UI which allows the user to update the remote db with all the locally aplied changes.
Example: I have a users object in the cache:
"User:1": {
name: "Tom",
enabled: true
},
"User:2": {
name: "John",
enabled: true
}
Now, let's say the UI user disables both users by setting enabled: false and presses "Save changes". At this point, I'd like all the local changes to be send; both objects should be send to remote and persisted there.
I tried several approaches but they all lead to rather hacky code.
Is there any canonic way of doing it?
Not sure if that's relevant, but I'm using "Hot Chocolate" graphql server for C#.