-
Notifications
You must be signed in to change notification settings - Fork 20.2k
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: Fix the long literal passed into the nested variable #26730
Conversation
I don't get it. Where does float come from? |
Because the parameters in the variables section are passed in json format, in the golang json library parser, an unquoted numeric literal is always parsed as float64. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically, this "makes sense" to me. However, you are adding a non-quoted decoding-format for uint64, and that might not be according to spec.
Typically, anything which can become "very large number" needs to be a quoted string, since javascript only have 53 bit integers natively.
So the implementation looks good to me, but I don't want us to introduce a spec-violation, need to look into that.
According to spec, https://eips.ethereum.org/EIPS/eip-1767
Fo the type |
GraphQL requests are parsed here: go-ethereum/graphql/service.go Line 45 in 13ef21d
Instead of trying to make it work with |
The problem is not about variables being nested. It's that some arguments have the type |
Closing this in favour of #26984. (If I misunderstood something, please let me know) |
Should be #26894
|
This commit fixes a bug in graphql when querying with variables and having nested types in variables.
Expected behaviour
Actual behaviour
# {"errors":[{"message":"unexpected type float64 for Long"}],"data":{}}