Subgraph
1 min read
Pronunciation
[suhb-graf]
Analogy
Like creating a custom view in a database that selects and transforms tables into a tailored report.
Definition
A specification in The Graph protocol defining how to index and query blockchain data, including a GraphQL schema, data sources, and mapping logic.
Key Points Intro
Subgraphs enable efficient, customizable indexing and querying of blockchain events.
Key Points
Manifest: defines data sources, ABIs, and events to index
Mapping: AssemblyScript functions transform events into entities
Schema: GraphQL definitions for queryable entity types
Deployment: published to The Graph network for indexing
Example
The Uniswap v3 subgraph indexes Swap, Mint, and Burn events to provide real-time liquidity and volume data via GraphQL queries.
Technical Deep Dive
Security Warning
Malformed or malicious mappings can crash indexing nodes; review AssemblyScript code carefully.
Subgraph - Related Articles
No related articles for this term.