Less than 1 minute
SubQuery simplifies and ensures type-safety when working with GraphQL entities, smart contracts, events, transactions, operation and effects.
yarn
yarn codegen
npm
npm run-script codegen
This action will generate a new directory (or update the existing one) named src/types
. Inside this directory, you will find automatically generated entity classes corresponding to each type defined in your schema.graphql
. These classes facilitate type-safe operations for loading, reading, and writing entity fields. You can learn more about this process in the GraphQL Schema section.
You can conveniently import all these types: