subgraph-development-guide

Guide building and deploying subgraphs for indexing blockchain data with The Graph protocol.

8|3|Updated Feb 25, 2026
One-click install
npx skills add https://github.com/Sperax/sperax-skills --skill subgraph-development-guide
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: subgraph-development-guide
Source: https://github.com/Sperax/sperax-skills/tree/main/skills/subgraph-development-guide
Command: npx skills add https://github.com/Sperax/sperax-skills --skill subgraph-development-guide

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides a comprehensive guide to building and deploying subgraphs for indexing blockchain data, solving the challenge of efficiently querying complex on-chain information.

Core Features & Use Cases

  • Subgraph Architecture: Understand the core components: Schema, Mappings, and Manifest.
  • Schema Design: Learn to define GraphQL entities for structured data.
  • Event Handling: Implement AssemblyScript mappings to process blockchain events.
  • Deployment: Covers deployment to The Graph Studio and self-hosted nodes.
  • Use Case: Indexing all token transfer events for a specific ERC20 token on Arbitrum to create a queryable API for tracking historical transfers and balances.

Quick Start

Use the subgraph-development-guide skill to learn how to deploy a subgraph for indexing ERC20 token transfers on Arbitrum.

Frequently Asked Questions about subgraph-development-guide

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build a subgraph to index blockchain data for my DeFi application?

You can index ERC20 token transfers on networks like Arbitrum by defining GraphQL entities for structured data, writing AssemblyScript mappings to process blockchain events, and deploying the subgraph to The Graph Studio to create a custom queryable API.

What is the role of AssemblyScript event handlers when creating a subgraph with The Graph?

AssemblyScript event handlers in subgraph mappings capture and parse blockchain events, mapping raw on-chain data to your defined GraphQL entities to build structured, queryable indexes for DeFi, NFTs, and other web3 applications.

How do I deploy a subgraph to The Graph Studio for indexing on-chain data?

You deploy a subgraph by configuring the subgraph manifest and using the Graph CLI to publish your schema and AssemblyScript mappings to The Graph Studio, generating a custom GraphQL API for querying blockchain data.

Can I use a self-hosted node instead of The Graph Studio to deploy my subgraph?

Yes, you can deploy your subgraph to a self-hosted Graph node as an alternative to The Graph Studio. This allows you to maintain full control over your blockchain data indexing infrastructure while still generating custom queryable APIs.

Do I need to define a GraphQL schema before writing mappings for my subgraph?

Yes, defining a GraphQL schema is required before writing subgraph mappings. The schema establishes the structured data entities that your AssemblyScript event handlers will populate when processing blockchain events during the indexing process.