Decide when a Subgraph result is fresh enough to show and final enough to act on. A Subgraph indexes chain data over time and serves queries from the latest indexed block, which can trail the chain head. GraphOps Subgraphs are reorg-aware, so recently indexed data can be corrected when the chain reorganizes.
Metadata query
Use _meta to inspect the indexed block and indexing-error state:
GraphQL
query SyncStatus {
_meta {
deployment
block {
number
hash
}
hasIndexingErrors
}
}
Output
{ "data": { "_meta": { "deployment": "QmTZ8ejXJxRo7vDBS4uwqBeGoxLSWbhaA7oXa1RvxunLy7",The deployment that served this request "block": { "number": 26285620,Highest indexed block; track it over time "hash": "0x7931a9fc337c615e67690a3083685a5680a72653718c13451f7697ea856b14f3"Include in support requests }, "hasIndexingErrors": falseAlert when true } }}Freshness model
| Signal | Meaning |
|---|---|
_meta.block.number | Highest indexed block served by the Subgraph endpoint. |
_meta.block.hash | Hash of the indexed block. Use it for diagnostics. |
_meta.deployment | Deployment serving the query. Useful when testing Endpoint Alias or Graph Network Subgraph ID changes. |
_meta.hasIndexingErrors | Whether indexing errors are present for the deployment. |
Reorg-aware behavior
Reorg-aware indexing means the served entity state can be corrected after a chain reorganization. Applications should:
- Treat recently indexed data as potentially revisable.
- Use
_meta.block.numberand_meta.block.hashin logs for support and debugging. - Avoid assuming that a newly indexed entity is final for settlement or irreversible user-facing state.
- Compare the indexed block with your network's finality information before treating a result as irreversible; elapsed time alone does not establish finality.
Apply the model
- Monitor
_metaon health checks and critical queries. - Log the endpoint mode: Deployment CID, Graph Network Subgraph ID, or Endpoint Alias.
- After changing an Endpoint Alias target, confirm
_meta.deploymentmatches the expected deployment. - If
_meta.hasIndexingErrorsis true, inspect query results carefully and contact GraphOps support(opens in a new tab).
Next steps
Last updated