THE GRAPH CHEAT SHEET

A developer’s cheat sheet for getting up to speed with subgraphs in 15 minutes

About The Graph

About Subgraphs

The Graph is the indexing and query layer of web3. Developers build and publish open APIs, called subgraphs, that applications can easily query using GraphQL.

A subgraph is a decentralized GraphQL API layer that sits between your UI layer and blockchain data layer. Subgraphs let you index data from the blockchain and query it over to your app’s frontend.

Learn more at thegraph.com/ecosystem/learn/

Anatomy of a Subgraph

<aside> 💡 Note: The subgraph folder structure includes several other files and folders such as generated, node_modules, build, etc. The above list only delineates the files that are involved in the subgraph definition process.

</aside>

Up-and-vibing with your first subgraph!

Installing the Graph CLI


Initializing your subgraph

graph init --index-events

<aside> 💡 Currently, the product option subgraph-studio is only available for subgraphs on Ethereum Mainnet

</aside>