Web3 Dictionary Logo
Web3 Dictionary
Contribute

Categories

AllBlockchainDappsDAOsDeFiNFTsRegulationSecuritySmart ContractsTokenomicsWalletsWeb3 GamingOthers
  1. Web3 Dictionary
  2. Dapps
  3. Subgraph
Dapps

Subgraph

A GraphQL API that indexes blockchain events and data for efficient querying.

Last Updated

2026-03-29

Related Concepts

IndexerBlockchainDAppEvent Log
Web3-Explorer Logo

Launch Web3 Apps

AD

Build secure dApps, tokens, DeFi & DAOs with a team focused on mainnet-ready delivery.

Explore Web3 Solutions

What is Subgraph?

A subgraph is a schema and set of rules that instructs an indexer to listen for specific blockchain events and organize them into a queryable database. It powers the GraphQL APIs that DApps use instead of scanning raw blockchain data.

How does Subgraph work?

  1. A developer defines which contract events to index and how to map them to entities like users, tokens, and transactions.
  2. The Graph's indexers run this code, monitoring the blockchain and updating a local database in real time.
  3. DApps query the subgraph's GraphQL endpoint to retrieve structured data instantly.

Why does Subgraph matter?

Without subgraphs, DApps would have to rescan the entire blockchain history for every query making them slow and expensive. Subgraphs do the indexing once and serve it to many applications efficiently.

Key features of Subgraph

  • Event-driven indexing of specific contract activity
  • Exposed via standard GraphQL APIs
  • Decentralized indexing via The Graph network
  • Real-time updates as new transactions are confirmed

Examples of Subgraph

Uniswap maintains subgraphs indexing all swaps, liquidity positions, and pool data. Aave's subgraph tracks lending, borrowing, and liquidation events.

OpenSea uses subgraphs to index NFT collection and trading data.

External References

  • The Graph Protocol
  • Ethereum Developer Docs