Home > Net >  How to allow serializing scalars as null for built in scalar in GraphQL-Java?
How to allow serializing scalars as null for built in scalar in GraphQL-Java?

Time:02-10

I am using built-in GraphQL-Java scalar type 'Float' for a field.

Reason I am using GraphQL-Float is : The Float type in GraphQL is equivalent to Double in Java.

GraphQL-Java version I am using : 11.0

Problem : When the field value is null, GraphQL-Java throws a CoercingSerializeException, is there any way/configuration, so that GraphQL-Java allows the null value to be returned and doesn't throw the exception.

I have found this issue raised on GraphQL-Java github repo :https://github.com/graphql-java/graphql-java/issues/1362, but it didn't provide any solution.

Or

I need to change my field type to some other scalar?

CodePudding user response:

  •  Tags:  
  • Related