-
Notifications
You must be signed in to change notification settings - Fork 660
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
Codegen GraphQL Float should be Kotlin Double #5927
Comments
This is unexpected. The GraphQL Float should be mapped to |
I'm using gradle to build kotlin client code from a graphql schema/query and the gradle codegen plugin. |
Sorry there was also a problem on the producing server getting kotlin's NaN and Infinity triggered that was fixed. I can try to trigger an exception tomorrow. |
Good catch, this should be public class GraphQLFloat {
public companion object {
// Should be kotlin.Double here instead
public val type: CustomScalarType = CustomScalarType("Float", "kotlin.Float")
}
} It is also very unlikely to be your problem. This is almost never used as the builtin scalars are optimized at build-time and do not use the custom scalar path. The only way you'd have to use it would be to reference Let us know if you can reproduce. If you can share the full stacktrace so that we get a better idea where this error is coming from. It might very well come from the server as you found out. |
Hi @bwilliams were you able to reproduce? Anything we can help with here? |
Hi @bwilliams, I'm going to assume this is working. We made the change in |
Do you have any feedback for the maintainers? Please tell us by taking a one-minute survey. Your responses will help us understand Apollo Kotlin usage and allow us to serve you better. |
Version
3.8.4
Summary
The gradle Kotlin codegen plugin is mapping GraphQL Float to kotlin.Float when it should be using kotlin.Double
Steps to reproduce the behavior
Follow codegen instructions.
Execute query in code on an API with GraphQL Float values that don't fit in a kotlin Float
Error "Can't serialize value ...: Expected type 'Float' but was 'Double'.
Logs
The text was updated successfully, but these errors were encountered: