Subgraph Migration

Convert TheGraph subgraph config, schema, and handlers to HyperIndex equivalents.

3|Updated Nov 27, 2025
One-click install
npx skills add https://github.com/enviodev/envio-plugins --skill subgraph-migration
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Subgraph Migration
Source: https://github.com/enviodev/envio-plugins/tree/main/plugins/envio-hyperindex/skills/subgraph-migration
Command: npx skills add https://github.com/enviodev/envio-plugins --skill subgraph-migration

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Migrating from TheGraph subgraphs to Envio HyperIndex can be complex due to differing config formats, schema representations, and handler patterns. This Skill provides a clear, end-to-end migration guide that aligns TheGraph concepts with HyperIndex equivalents to reduce risk and accelerate adoption.

Core Features & Use Cases

  • Guides config migration from subgraph.yaml to HyperIndex config.yaml, including start_block and network mappings.
  • Demonstrates schema conversion rules (Bytes/BigInt to Strings/BigInt, @entity removal, _id relationships, and @derivedFrom usage) with concrete examples.
  • Covers handler migration and dynamic contract registration (contractRegister), including how to adapt event handlers and write stable, immutable entity updates.

Quick Start

Convert subgraph.yaml to HyperIndex config.yaml, migrate the GraphQL schema and TypeScript handlers, and register dynamic contracts to complete the migration.

Frequently Asked Questions about Subgraph Migration

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

FAQPage Schema
How do I migrate a TheGraph subgraph to HyperIndex?

Migrate a TheGraph subgraph to HyperIndex by converting subgraph.yaml to config.yaml, adapting the GraphQL schema, translating TypeScript event handlers, and registering dynamic contracts using contractRegister.

What are the schema conversion rules when moving from TheGraph to HyperIndex?

Schema migration from TheGraph to HyperIndex requires removing @entity directives, converting Bytes to Strings, maintaining BigInt, mapping _id relationships, and adapting @derivedFrom usage to match HyperIndex schema representations.

Does HyperIndex support dynamic contract registration for migrated subgraphs?

HyperIndex supports dynamic contract registration through the contractRegister mechanism, allowing migrated TheGraph event handlers to adapt to dynamically deployed contracts during indexing.

How do I map start_block and network settings from subgraph.yaml to HyperIndex config?

Config migration translates start_block and network parameters from subgraph.yaml directly into the HyperIndex config.yaml, ensuring the indexer begins reading events from the correct historical block on the specified network.

What is the best way to translate TheGraph event handlers for HyperIndex?

Translate TheGraph event handlers to HyperIndex by adapting the TypeScript handler logic to write stable, immutable entity updates that align with the converted HyperIndex schema and config definitions.

Why does my migrated subgraph schema fail in HyperIndex?

Migrated subgraph schemas fail in HyperIndex when TheGraph-specific syntax like @entity directives or Bytes types remains unconverted, requiring strict schema adaptation to HyperIndex equivalents like Strings.