github graphprotocol/graph-tooling v0.3.0
0.3.0

latest releases: @graphprotocol/graph-cli@0.71.1, @graphprotocol/graph-ts@0.35.1, @graphprotocol/graph-cli@0.71.0...
5 years ago

Changes

  • Fixes the entity.getArray method declaration
  • Generates exported TypeScript classes from ABIs
  • Switches to @graphprotocol/graph-ts for runtime sources
  • Switches to explicit imports instead of injecting globals into mappings
  • graph build and graph deploy no longer include graph codegen — it's a separate step now

Explicit imports

Every subgraph project now has to add a separate dependency:

npm install --dev @graphprotocol/graph-ts # NPM
yarn add --dev @graphprotocol/graph-ts    # Yarn

Types and APIs like Entity, store, ipfs etc. are no longer automatically injected into subgraph mappings as globals. The same goes for types generated from ABIs. They now have to be imported explicitly:

import { Entity, store, ipfs } from '@graphprotocol/graph-ts'
import { SomeContract, SomeEvent } from './types/abis/SomeDataSource/SomeContract'

function handleSomeEvent(event: SomeEvent) {
  ...
}

Note: The behavior of the provided types and ABIs has not changed.

Don't miss a new graph-tooling release

NewReleases is sending notifications on new releases.