the-graph

Build and deploy subgraphs indexing blockchain events into queryable GraphQL APIs.

1|1|Updated May 21, 2026
One-click install
npx skills add https://github.com/naruto11eth/cryptoskills --skill the-graph-naruto11eth
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: the-graph
Source: https://github.com/naruto11eth/cryptoskills/tree/main/skills/the-graph
Command: npx skills add https://github.com/naruto11eth/cryptoskills --skill the-graph-naruto11eth

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? AI agents frequently produce outdated or incorrect guidance for The Graph protocol, such as using the deprecated hosted service, writing mappings in standard TypeScript instead of AssemblyScript, or skipping the codegen step, which leads to failed builds and halted indexing. ## Core Features & Use Cases - Subgraph Development: Covers the full lifecycle from graph init through schema design, manifest configuration, AssemblyScript mappings, codegen, build, and Subgraph Studio deployment. - GraphQL Querying: Documents filtering, cursor-based pagination, time-travel queries, full-text search, and Graph Client integration for type-safe frontend queries. - Indexing Optimization & Alternatives: Explains immutable entities, pruning, startBlock tuning, and when to choose Ponder, Dune, or direct RPC multicall instead. - Use Case: Ask the agent to create a subgraph indexing USDC Transfer events on Ethereum mainnet, and it will produce a correct schema.graphql, subgraph.yaml, and AssemblyScript mapping with proper null checks and try_ contract reads. ## Quick Start Create a subgraph that indexes Transfer events for the USDC contract on Ethereum mainnet and deploy it to Subgraph Studio.

Frequently Asked Questions about the-graph

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

FAQPage Schema
How do I create and deploy a subgraph to Subgraph Studio?

Run graph init to scaffold the project, define entities in schema.graphql, configure subgraph.yaml, write AssemblyScript mappings, then run graph codegen and graph build. Authenticate with graph auth --studio and deploy using graph deploy --studio with a version label.

The Graph vs Ponder vs Dune for blockchain indexing?

The Graph suits production dApp backends needing decentralized GraphQL APIs. Ponder offers TypeScript-native handlers with hot reloading for rapid iteration. Dune provides SQL over pre-indexed data for analytics dashboards but not real-time application backends.

Why does my subgraph build fail with TypeScript errors?

Mappings are AssemblyScript, not TypeScript, so closures, optional chaining, Array.map, and try/catch do not compile. Also run graph codegen before graph build, since imports from the generated directory fail without it.

Is the Graph hosted service still available for deployments?

No, the hosted service is deprecated and stopped serving queries in Q2 2024. Use Subgraph Studio exclusively for deployment and testing, then publish to the decentralized network for production.

Why does my subgraph stop indexing at a specific block?

A deterministic error in a handler, such as a null dereference, division by zero, or a non-try contract call that reverted, halts indexing permanently. Check Studio logs, fix the handler logic, and redeploy a new version.

How do I paginate large subgraph query results?

Queries return at most 1000 entities and skip is capped at 5000. Use cursor-based pagination with id_gt and orderBy id to efficiently page through datasets of any size.