-
Notifications
You must be signed in to change notification settings - Fork 534
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GraphQL fails on a serialization of special float values #1811
Comments
According to the spec, Can you report the issue to GraphQL-Java? |
@tsegismont, yes, will do it tomorrow. |
@tsegismont it looks like they already have issues for NaNs (graphql-java/graphql-java#1062) and for infinities (graphql-java/graphql-java#1998). If I understand correctly, the implementation was created before the specification was updated to describe a proper handling of NaNs. |
@fedinskiy thanks for letting us know. I'm closing the issue as this is something that needs to be handled in either user's code or GraphQL-Java |
@fedinskiy I'd describe my proposal as a clarification of the language in the spec rather than a removal. |
Version
3.9.5
Context
When a Graphql server tries to return a special float value(NaN or one of the Infinites), it fails with the exception "Expected type 'Float' but was 'Float'."
Do you have a reproducer?
https://github.com/vert-x3/vertx-web/blob/907f4d638a01c00bcb71465c25d79094986204d3/vertx-web-graphql/src/test/java/io/vertx/ext/web/handler/graphql/ReproduceServer.java
Steps to reproduce
Expected result: some data is received
Actual result: Error with message "Can't serialize value (/${fieldname}) : Expected type 'Float' but was 'Float'."
Extra
Java 8
Also, it looks like the cause of the bug lies in the GraphQL java library, which uses BigDecimal for serialization of float values. And according to its documentation, BigDecimal is unable to handle NaN and ±Infinity.
The text was updated successfully, but these errors were encountered: