graphprotocol / graphprotocol/graph-node
error code for errors like block number not yet indexed
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 3.2k
- Forks
- 1.1k
- Avg merge
- 4d 1h
- Merged PRs (30d)
- 1
Description
Do you want to request a feature or report a bug?
Feature
What is the current behavior?
Currently when making a query with the block parameter, like
{
tokens(block: {number: 10000000}) {
id
owner
}
}
We get an error like :
{
"errors": [
{
"message": "Failed to decode `block.number` value: `subgraph QmX2cspb9qty6nzUEwf7iw6jU7ptwk6hBp9VVhsHdHHcMA has only indexed up to block number 9753342 and data for block number 10000000 is therefore not yet available`"
}
]
}
What is the expected behavior?
It would be great to have error code so we can easily differentiate between different type of error, instead of parsing the error message
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue's GraphQL query and current error response are the starting point; trace how block-number validation errors are surfaced. Done means clients can distinguish this not-yet-indexed condition from other errors without parsing the message text, with coverage for the shown query.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- graphql, rust
- Domain
- api, backend, blockchain
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100