Collection
Developers
Author a subgraph, or decide you want Substreams or the Token API instead. Three lanes onto the same data, with different costs.
01
Subgraphs
- What a subgraph actually is Three files that together define a deterministic function from chain events to queryable rows. Getting the mental model right saves you from most subgraph bugs.
- Building and publishing, and what each step commits you to Studio for development, the network for production. The decisions that are hard to undo, and the one that determines whether anyone indexes your work at all.
- Querying from an application An API key, a gateway endpoint, and a set of assumptions about latency and freshness that will bite you if you leave them implicit.
02
Practice
- Why your subgraph is slow Three modelling decisions account for most of the difference between a subgraph that syncs in hours and one that takes days. None of them is about how clever your handler code is.
- Pruning, and what history costs A subgraph's database grows forever unless you tell it not to. Pruning is the switch, and it trades away two features you may be relying on without realising.
- Grafting, and shipping a fix without a resync It reuses an existing subgraph's data and carries on from a chosen block, turning a multi-day resync into a deploy. The docs advise against it exactly where you will want it most.
03
The other lanes
- Substreams Composable WASM modules over a Firehose stream. Reach for it when backfill time, throughput or a non-GraphQL destination is your actual problem.
- Firehose The extraction layer everything else stands on. You will probably never touch it, and knowing what it does explains why the layers above behave as they do.
- The Token API Balances, transfers, prices and NFTs over REST, across several chains, with no subgraph to author. The right first answer more often than developers expect.
04
Choosing
- Choosing a data service A decision matrix that admits where each option loses, and a default that is right more often than the interesting answer.
- The alternatives, honestly The Graph is one of several ways to get indexed chain data, and it is the right answer less often than a site like this usually admits. Here is what the others are for.
Elsewhere
This collection explains why. Two other places carry the rest.
The procedure Official developer docs
Exact steps, flags and configuration, maintained by the people who ship the code.
This site does not duplicate them and never will.
The live numbers Subgraph Dock on Lodestar
Nothing here updates on its own. Live stake, signal, fees and indexer
performance come from a dashboard reading the network.