Skip to content

Latest commit

 

History

History
30 lines (19 loc) · 1.55 KB

README.md

File metadata and controls

30 lines (19 loc) · 1.55 KB

Subgraph Composition Example

This repository provides a minimal example of how to use the new subgraph composition feature of The Graph.

What is The Graph?

The Graph is a powerful, decentralized protocol that enables seamless querying and indexing of blockchain data. It simplifies the complex process of querying blockchain data, making DApp development faster and easier.

What is subgraph composition?

Subgraph composition allows a subgraph to depend on another subgraph as a data source, allowing one subgraph to consume and react to the data or entity changes of another subgraph. This feature enables modular subgraph architectures.

Instead of interacting directly with on-chain data, a subgraph can be set up to listen to updates from another subgraph and react to entity changes. This can be used for a variety of use cases, such as aggregating data from multiple subgraphs or triggering actions based on changes in external subgraph entities.

How to use subgraph composition?

The example defines 3 source subgraphs:

and a composed subgraph that combines and aggregates the information from the 3 source subgraphs: