-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Clarification: scalar coercion rules and default input values #868
Comments
No, the When it comes to output, the spec states:
For example if you were using protobuf as your response format then you'd want to use the Mostly with GraphQL we use JSON (but that's not required) which doesn't explicitly differentiate between int and float, so representing the float in the simplest format ( TL;DR: no, just returning the float |
@benjie that seems reasonable. What does this sentence of the specification refer to?
If the coercion of |
That's a programming-language-agnostic description of how to convert an int to a float.
During coercion; i.e. if you receive an int where a float was expected, convert it to a float that has the same integer part and an empty fractional part. |
Thank you for the clarification! |
I'm hoping to get some clarification around the
Float
portion of the specification.Specifically, I'm considering the input coercion section and how this relates to default values.
Say we have the schema
and we do an introspection query for the default value of
Example.f
Should the
defaultValue
that comes back on the introspection query response be"1"
(as written) or"1.0"
(according to the input coercion rules)?The text was updated successfully, but these errors were encountered: