dsys / cleargraph

⛓ Cleargraph is a GraphQL runtime for decentralized applications
Other
254 stars 14 forks source link

ethereumBlock(hash: ?) expects a hex value #32

Closed jdjkelly closed 6 years ago

jdjkelly commented 6 years ago

This query returns the following error:

query {
  ethereumBlock(number: 5878023) {
    number
  }
}
{
  "data": {
    "ethereumBlock": null
  },
  "errors": [
    {
      "locations": [
        {
          "column": 2,
          "line": 1
        }
      ],
      "message": "Returned error: invalid argument 0: hex string without 0x prefix",
      "path": [
        "ethereumBlock"
      ]
    }
  ]
}

But the schema says that the number input should be an int (surely this is intended to be the block height...), for one, and if you instead pass the argument hash to the query, with the hex-value hash of block, and query the number property, you get back an int as expected:

query {
  ethereumBlock(hash:"0x2677dedc524bc4de6447e8996ba724ef3fe14712de2e12a81b3fa8f66b17a980") {
    network,
    number
  }
}
{
  "data": {
    "ethereumBlock": {
      "network": "MAINNET",
      "number": 5878023
    }
  }
}

Am I missing something here?

kern commented 6 years ago

oops, forgot to pass an argument from the resolver. thanks for the report @jdjkelly!