You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, ZeroQL will serialize a model to JSON text with all the properties, regardless of whether or not they've been assigned, except properties that have a value of null.
This is a problem for any nullable properties that should, during a mutation, be assigned to a value of null.
I propose that models should track which properties have been assigned, and only properties that have been assigned should be in the resulting payload to the server.
Below is an example of a possible implementation of what the generated model code would be...
classFoo{privatereadonlyDictionary<string,object>assignedProperties=new();// all models would have this fieldprivatestring?text;publicstring?Text{get=>text;set=>assignedProperties["Text"]=text=value;}privateintcount;publicintCount{get=>text;set=>assignedProperties["Count"]=text=value;}}
And then whenever serialization happens, it would serialize foo.assignedProperties instead of foo itself.
The text was updated successfully, but these errors were encountered:
Currently, ZeroQL will serialize a model to JSON text with all the properties, regardless of whether or not they've been assigned, except properties that have a value of
null
.This is a problem for any nullable properties that should, during a mutation, be assigned to a value of
null
.I propose that models should track which properties have been assigned, and only properties that have been assigned should be in the resulting payload to the server.
Below is an example of a possible implementation of what the generated model code would be...
And then whenever serialization happens, it would serialize
foo.assignedProperties
instead offoo
itself.The text was updated successfully, but these errors were encountered: