Overview
The subgraph manifest specifies all the information required to index and query a specific subgraph. This is the entry point to your subgraph. The subgraph manifest, and all the files linked from it, is what is deployed to IPFS and hashed to produce a subgraph ID that can be referenced and used to retrieve your subgraph in The Graph.Spec Version: v.0.0.4
Format
Any data format that has a well-defined 1:1 mapping with the IPLD Canonical Format may be used to define a subgraph manifest. This includes YAML and JSON. Examples in this document are in YAML.Top-Level Fields
A Semver version indicating which version of this API is being used.
An optional description of the subgraph’s purpose.
An optional link to where the subgraph lives.
An optional base to graft onto. See Graft Base for details.
Each data source spec defines the data that will be ingested as well as the transformation logic to derive the state of the subgraph’s entities based on the source data.See Data Sources for complete documentation.
Each data source template defines a data source that can be created dynamically from the mappings.See Data Source Templates for complete documentation.
A list of feature names used by the subgraph. Required for
specVersion >= 0.0.4.See Features for available feature names.Schema
The schema defines the GraphQL types that will be generated for your subgraph.The path of the GraphQL IDL file, either local or on IPFS.See Path for format details.
Example
Path
A path has one fieldpath, which either refers to a path of a file on the local dev machine or an IPLD link.
When using the Graph-CLI, local paths may be used during development, and then, the tool will take care of deploying linked files to IPFS and replacing the local paths with IPLD links at deploy time.
A path to a local file or IPLD link.
- Local Path
- IPLD Link
Graft Base
A subgraph can be grafted on top of another subgraph, meaning that, rather than starting to index the subgraph from the genesis block, the subgraph is initialized with a copy of the given base subgraph, and indexing resumes from the given block.The subgraph ID of the base subgraph.This is the IPFS hash of the deployed subgraph.
The block number up to which to use data from the base subgraph.Indexing will resume from this block number.
Example
Features
Starting fromspecVersion 0.0.4, a subgraph must declare all feature names it uses to be considered valid.
No validation errors will happen if a feature is declared but not used.
Available Features
Enables non-fatal error handling in mappings. When enabled, errors in handlers won’t stop the subgraph from syncing.
Enables full-text search capabilities on entities. Requires special field annotations in the schema.
Enables grafting functionality. Required when using the
graft field in the manifest.Enables IPFS data fetching from Ethereum contract events and calls.
Example
Complete Manifest Example
- Basic Subgraph
- With Templates
- With Grafting
Next Steps
Data Sources
Learn about configuring data sources
Mappings
Configure handlers and mapping logic

