Subgraphs Quickstart
A developer’s guide to developing and deploying to Alchemy Subgraphs.
What is a Subgraph?
Subgraphs are an open-source tool for building custom GraphQL APIs with blockchain data.
How it works
- Write your subgraph code.
- Deploy to Alchemy Subgraphs.
- Query live blockchain data through your GraphQL API.
Why use a subgraph?
- Ship in days, not weeks - Spend up to 50% less time on data indexing and dealing with forks / reorgs.
- Simplify your infrastructure - Save hours every week on infra maintenance or downtime.
Getting Started
Creating a new subgraph
-
Install the
graph-cli
:bash -
Retrieve contract address and related ABI.
-
Create a new subgraph:
bash -
Make modifications as necessary to the manifest, schema, and handlers.
-
See Developing a Subgraph for more details.
Deploying your subgraph
-
Get your deploy key from your Alchemy Dashboard.
-
Run the following:
bashSee Deploying a Subgraph for more details.
-
You’ll receive a link to view your newly deployed subgraph. Congrats! 🎉