Learn how to work with the open-source graph-cli
package.
The graph-cli
package contains commands that help you create, develop, and publish your subgraph.
Installation
# NPM
npm install -g @graphprotocol/graph-cli
# Yarn
yarn global add @graphprotocol/graph-cli
Commands
Command | Description |
---|---|
graph init | Creates a new subgraph project |
graph codegen | Generates AssemblyScript types for smart contract ABIs and the subgraph schema |
graph deploy | Deploys a subgraph (See Deploying a Subgraph) |
graph add | Adds a new datasource to the yaml file and updates schema.graphql, abis, and mappings |
graph test | Runs unit tests with Matchstick |
See full specification for additional commands and details.