What is Subgraph?
A subgraph is a data indexing definition for The Graph protocol that specifies what blockchain data to extract, how to transform it, and how to store it — creating a queryable API from raw on-chain events.
WHY IT MATTERS
Subgraphs are the recipes for indexed blockchain data. A developer defines: which smart contracts to watch, which events to index, how to transform event data into stored entities, and the GraphQL schema for querying.
Once deployed, The Graph's indexer nodes process the subgraph — scanning the blockchain for matching events, executing the transformation logic, and serving query results through a GraphQL API.
Subgraphs power the data layer of major dApps. Uniswap's analytics, Aave's dashboards, and hundreds of other applications rely on subgraphs for fast, structured access to on-chain data.