Skip to content

Sync and reorgs

Use _meta to understand Subgraph sync status, indexed blocks, and reorg-aware query behavior.

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.

Queries are served from the highest indexed block, which _meta.block.number reports. Recently indexed data can still be corrected by a reorganization, so compare it with the network's finality before treating it as irreversible.

Metadata query

Use _meta to inspect the indexed block and indexing-error state:

query SyncStatus {
  _meta {
    deployment
    block {
      number
      hash
    }
    hasIndexingErrors
  }
}
{  "data": {    "_meta": {      "deployment": "Qm...",The deployment that served this request      "block": {        "number": 18000000,Highest indexed block; track it over time        "hash": "0x..."Include in support requests      },      "hasIndexingErrors": falseAlert when true    }  }}
An illustrative health check. Record all four values on each run so you can spot lag, an unexpected deployment, or indexing errors.

Freshness model

SignalMeaning
_meta.block.numberHighest indexed block served by the Subgraph endpoint.
_meta.block.hashHash of the indexed block. Use it for diagnostics.
_meta.deploymentDeployment serving the query. Useful when testing Endpoint Alias or Graph Network Subgraph ID changes.
_meta.hasIndexingErrorsWhether 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.number and _meta.block.hash in 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 _meta on 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.deployment matches the expected deployment.
  • If _meta.hasIndexingErrors is true, inspect query results carefully and contact GraphOps support.

Next steps