Definition
A subgraph is a formal description of specific blockchain data that should be indexed and exposed by an indexing protocol. It defines which smart contracts, events, and fields are relevant, and how they relate to each other in a structured data model. By following this definition, an indexing service can transform raw blockchain transactions into organized, queryable information. The subgraph itself is a conceptual blueprint, not the data, that guides how blockchain information is collected and presented.
In Simple Terms
In simple terms, a subgraph is like a focused map of the parts of a blockchain that an application cares about. Instead of dealing with every transaction and detail on the chain, the subgraph points to only the relevant pieces and arranges them in an easy-to-read structure. This makes it possible for apps to quickly look up on-chain information without scanning the entire blockchain each time. The concept helps turn complex blockchain activity into clean, app-ready data.
Context and Usage
Subgraphs are commonly used in environments where many applications need reliable, structured access to on-chain data. They sit between raw blockchain records and the user-facing interface, defining how data is organized for efficient querying. Multiple subgraphs can exist for different use cases, each focusing on a particular set of contracts or activities. As a concept, a subgraph standardizes how blockchain data is described so that various tools and services can interact with it in a consistent way.