indexing-schema

Define and validate GraphQL schemas for Envio HyperIndex mappings.

2|3|Updated Mar 4, 2026
One-click install
npx skills add https://github.com/moose-code/polymarket-indexer --skill indexing-schema-moose-code
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: indexing-schema
Source: https://github.com/moose-code/polymarket-indexer/tree/main/.claude/skills/indexing-schema
Command: npx skills add https://github.com/moose-code/polymarket-indexer --skill indexing-schema-moose-code

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Use when defining or editing schema.graphql. Entity types, scalar types, enums, relationships, @derivedFrom, @index, @config directives, array rules, naming conventions, and schema-to-TypeScript type mapping.

Core Features & Use Cases

  • Schema rules for entity definitions: every type is an entity; no @entity decorator; id: ID! must be first; relationships use the entity type directly; codegen appends _id to reference fields.
  • Scalar and enum mappings: support ID!, String!, Int!, Float!, Boolean!, BigInt!, BigDecimal!, Bytes!, Timestamp!, Json! and enum declarations; mapping to TypeScript types is handled via codegen.
  • Directives and indexing: @derivedFrom, @index, and @config directives to model relationships, query optimization, and numeric precision.
  • Array and relationship rules: guidelines for arrays like [Type!]! and proper derivedFrom usage to enable correct codegen.
  • Deep documentation: reference to HyperIndex docs for comprehensive behavior.

Quick Start

Create or update your schema.graphql to define entities with proper id placement, correct relationships, and mappings to TypeScript types via codegen.

Frequently Asked Questions about indexing-schema

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

FAQPage Schema
How do I define entity types in a GraphQL schema for Envio HyperIndex?

To define entity types in a GraphQL schema for Envio HyperIndex, declare standard types without the @entity decorator, ensure the first field is id: ID!, and use the entity type directly for relationships. Codegen automatically appends _id to reference fields for TypeScript mappings.

What GraphQL directives are supported for Envio HyperIndex schema relationships?

Envio HyperIndex schema relationships support the @derivedFrom directive to model inverse relationships, the @index directive for query optimization, and the @config directive to manage numeric precision during code generation.

How does GraphQL schema codegen map scalar types to TypeScript in HyperIndex?

GraphQL schema codegen maps scalar types to TypeScript in HyperIndex by converting supported primitives like ID!, String!, Int!, Float!, Boolean!, BigInt!, BigDecimal!, Bytes!, Timestamp!, and Json! into their corresponding TypeScript handler types.

What are the array rules for GraphQL schema definitions in Envio?

Array rules for GraphQL schema definitions in Envio require proper non-null syntax like [Type!]! for array fields. Following these guidelines ensures correct code generation for TypeScript mappings and proper relationship handling.

Can I use enums in my schema.graphql for Envio data indexing?

Yes, you can use enums in your schema.graphql for Envio data indexing. Enum declarations are fully supported, and their TypeScript type mappings are automatically generated during the codegen process alongside scalar types.

Why is my Envio HyperIndex schema codegen failing with relationship errors?

Envio HyperIndex schema codegen fails with relationship errors when entity types omit the mandatory id: ID! first field, incorrectly apply the @entity decorator, or misuse @derivedFrom directives on array fields, violating required codegen constraints.