Dotnet nullable types not compatible with graphql

I’m migrating from the Realm Cloud.

If I define nullable types in the dotnet RealmObject

public double? A { get; set; }

and save it as null
the document saved in mongodb will be like

{

A: null

}

and the following error will occur when querying in graphql interface

  1. message: “reason="could not validate document: \n\tA: Invalid type. Expected: undefined, given: null"; code="SchemaValidationFailedRead"; untrusted="read not permitted"; details=map

Anyone can help? Thanks a lot!

Hi Sing_Leung,

GraphQL will return that error message whenever its source data contains fields with “null” values. You can get around this by setting the Validation Level/Action for Reads to “Off” or “Warn”. You can do this in the Realm UI, select GraphQL on the left, then select the Settings Tab.

Regards,
David Griffith

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.