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
It's possible to globally specify how nulls and missing values should be handled by the deserializer. I'm not sure of the full implications of this but I believe ignoring nulls may be safe considering default nullability of GraphQL types. Missing members may mask errors though.
--- GraphQLDeserilization.cs+++ GraphQLDeserilization.cs@@ -22,7 +22,11 @@
var converters = GetFieldConverters(fields);
// Get JsonSerilizerSettings
- var settings = new JsonSerializerSettings();+ var settings = new JsonSerializerSettings+ {+ NullValueHandling = NullValueHandling.Ignore,+ MissingMemberHandling = MissingMemberHandling.Ignore,+ };
foreach (var converter in converters)
{
The text was updated successfully, but these errors were encountered:
I have found a scenario that causes a null dereference in GraphQLDeserilization.cs:L92.
This response causes the error when a
GraphQLUnionOrInterface
is involved yet works fine when there is no inheritance.E.g.
FooQuery
works fine andFoo
isnull
.FooBarQuery
causes an issue in the deserializer.Client fix
It's possible to fix the client by annotating the potentially null value with
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
.Possible library fix
It's possible to globally specify how nulls and missing values should be handled by the deserializer. I'm not sure of the full implications of this but I believe ignoring nulls may be safe considering default nullability of GraphQL types. Missing members may mask errors though.
The text was updated successfully, but these errors were encountered: