GraphQL interface to Ethereum node data

Thanks for your hard work! I’m just about to leave on a week’s vacation, but I’ll take a close look as soon as I get back.

1 Like

I encountered an issue with Long. JavaScript can represent numbers up to 53 bits, that’s why Long is not part of the GraphQL spec. Our schema uses a custom Long type defined as a 64-bit int in these cases:

  • gas-related (cumulativeGasUsed, estimateGas, gas, gasLimit, gasUsed)
  • block-indexing (highestBlock, etc)
  • counting states (knownStates, pulledStates)
  • nonce
  • transactionCount

I think we should use a custom Int53 in cases where it’s feasible and use BigInt for the rest. Or maybe define Long in a way that it returns an integer if it fits in 53 bits and a hex-encoded string otherwise, like in this example. So it would be an error to input or output “0x1” because it would fit into the 53 bits.