-
Notifications
You must be signed in to change notification settings - Fork 20.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
"unexpected type float64 for Long" error when run graphql with parameters of type Long #24683
Comments
:[25c9b49]
เมื่อ วันอังคารที่ 12 เมษายน ค.ศ. 2022, ngugcx ***@***.***>
เขียนว่า:
… System information
Geth version: geth version
/ # geth version
Geth
Version: 1.10.17-stable
Git Commit: 25c9b49
Architecture: amd64
Go Version: go1.18
Operating System: linux
OS & Version: Windows/Linux/OSX
/ # uname -a
Linux 69c4dda6023d 5.4.0-81-generic #91-Ubuntu SMP Thu Jul 15 19:09:17 UTC 2021 x86_64 Linux
Commit hash : (if develop)
Expected behaviour
curl 'http://localhost:8545/graphql' --data-raw $'{"query":"query blocks($from_: Long!, $to_: Long!) { blocks(from: $from_, to: $to_) { number hash timestamp }}","variables":{"from_":14000000,"to_":14000001},"operationName":"blocks"}'
It should return the specified block info.
Actual behaviour
It returns:
{"errors":[{"message":"unexpected type float64 for Long"}],"data":{}}
Steps to reproduce the behaviour
Run geth as below:
geth --txlookuplimit=1000000 --http --http.addr=0.0.0.0 --http.api eth,net,web3 --http.corsdomain="*" --http.vhosts="*" --graphql --graphql.corsdomain="*" --graphql.vhosts="*" --ws --ws.addr=0.0.0.0 --ws.api eth,net,web3
Backtrace
[backtrace]
When submitting logs: please submit them as text and not screenshots.
—
Reply to this email directly, view it on GitHub
<#24683>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AQDJWKYUIHYH4HVDDTENJPDVEUJU3ANCNFSM5TFPUGRA>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Try sending the values as strings, i.e.:
|
Yes, strings work. |
So interestingly this only happens when using variables. Embedding the value in the query itself works fine, e.g. Edit: created an issue upstream graph-gophers/graphql-go#514 |
System information
Geth version:
geth version
OS & Version: Windows/Linux/OSX
Commit hash : (if
develop
)Expected behaviour
It should return the specified block info.
Actual behaviour
It returns:
Steps to reproduce the behaviour
Run geth as below:
Backtrace
When submitting logs: please submit them as text and not screenshots.
The text was updated successfully, but these errors were encountered: