Hey @Sing_Leung - do you mind pasting your JSON schema here?
IsFatal is required
From what I can tell, the workaround here would be to explicitly set isFatal to False because types cannot be nullable according to JSON schema at the moment, or ensure the field is not required in your schema.
What is the type defined for EffectiveFrom in your JSON Schema? If it is not explicitly “null” this will not work. You will have to make sure this field is not required in this json schema and then not explicitly pass in a “null” value.
This is because GraphQL only currently supports undefined for non-required fields instead of both undefined and null. null is a separate type in MongoDB.
Hi @Sumedha_Mehta1
I think the problem is the way it syncs and creates schema for primitive types in dotnet.
if I define the following properties in a RealmObject
public bool A { get; set; }
public int B { get; set; }
public double C { get; set; }
they will be “required” in the generated schema
however, if the values of those fields are zero or false (I’ve tried to explicitly set them in C#), they will be missing in the synced document
so when I tried to use GraphQL, the error occurs.
I think I can workaround the nullable datetime, but I need to store zero or false for numbers and bool.
Hey @Sing_Leung, this is an issue we’re actively working to resolve and hope to have a proper fix soon-ish. In the meantime, you can work around it by explicitly setting the default values after adding the object to the Realm. Something like: