Let me explain:
I am using Gson as deserializer, MongoDB as storage and the newly Spring GraphQL
Let's say I have an object O in database with the fields:
A = 6
B = null
If the frontend send an update on the B field so I receive a JSON with only the B field with its value, so I receive O with:
B = 1
Then after deserialization, in Java my object O will have the following fields:
A = null
B = 1
Then, in MongoDB it will save:
A = null
B = 1
So the value of A will be overwritten by null, and we don't want that, the frontend only wanted to update the field B.
How do you solve that gracefully?