GraphNodeのSUBGRAPHのABIsタイプを生成する

Gitからクローンする

git clone https://github.com/graphprotocol/ens-subgraph

Yarnでコードを生成する

cd ens-subgraph
yarn
yarn codegen
yarn run v1.22.5
$ graph codegen --output-dir src/types/
  Skip migration: Bump mapping apiVersion from 0.0.1 to 0.0.2
? Apply migrations
? Load subgraph from subgraph.yaml
  Load contract ABI from abis/Registry.json
  Load contract ABI from abis/PublicResolver.json
  Load contract ABI from abis/AuctionRegistrar.json
? Load contract ABIs
  Generate types for contract ABI: EnsRegistry (abis/Registry.json)
  Write types to src/types/ENSRegistry/EnsRegistry.ts
  Generate types for contract ABI: Resolver (abis/PublicResolver.json)
  Write types to src/types/Resolver/Resolver.ts
  Generate types for contract ABI: AuctionRegistrar (abis/AuctionRegistrar.json)
  Write types to src/types/AuctionRegistrar/AuctionRegistrar.ts
? Generate types for contract ABIs
? Generate types for data source templates
? Load data source template ABIs
? Generate types for data source template ABIs
? Load GraphQL schema from schema.graphql
  Write types to src/types/schema.ts
? Generate types for GraphQL schema

Types generated successfully

コメント