Skip to content

Releases: graphprotocol/graph-tooling

v0.8.0

09 Apr 12:17
Compare
Choose a tag to compare
  • graph init now has two modes:
    • --from-example creates a subgraph from the example subgraph.
    • --from-contract creates a subgraph from an existing contract, fetching the contract ABI from Etherscan if possible, and creating entities for all events emitted by the contract.
    • If not all arguments for one of these modes are provided, graph init will guide the user through an interactive form.
  • graph codegen now handles indexed event parameters correctly.
  • There is a subgraph migration framework in place now to automatically update subgraphs to the latest APIs if possible. This can be skipped with --skip-migrations.
  • graph codegen now supports BigDecimal for large decimal numbers.
  • Other changes:
    • Rewrite CLI commands using Gluegun.
    • Add progress indicators.
    • Make output formatting more consistent.
    • Add tests for the new graph init.
    • Warn if manifests contain the example subgraph repository and description.
    • Add Prettier.

v0.5.1

20 Dec 13:57
Compare
Choose a tag to compare
  • Fix #169 (handling optional boolean, i32 and other primitive entity attributes incorrectly).
    • To unset primitive fields, entity.unset('fieldName') is now the way to go.
    • To explicitly check whether any field is set on an en entity, use entity.isSet('fieldName').
  • Fix graphprotocol/graph-node#600 (data from different entities being mixed up due to non-deterministic use of previously used memory).

v0.5.0

08 Dec 12:28
Compare
Choose a tag to compare

Changes

  • Automatically export memory.allocate (previously allocate_memory) so you don't have to.
  • Generate new SomeEntity.load(id) and someEntity.save() wrappers around the store API.
  • Various subgraph validations have been added to the CLI, including catching:
    • invalid contract addresses,
    • invalid ABI references,
    • invalid or unsupported ABI files,
    • events that are not present in the ABI,
    • invalid field types in the GraphQL schema, and
    • entity types with missing id fields.
      Most of these validations will show a list of possible solutions.
  • Support for new subgraph manifest fields has been added:
    • description and repository at the top level,
    • network (one of mainnet, ropsten, rinkeby, kovan, to be extended) at the data source level.
  • The AssemblyScript version has been bumped to the latest master.

Fixes

  • Bypass authentication if the system keychain cannot be accessed (useful for CI systems and other headless or non D-Bus systems).

v0.4.1

15 Nov 08:52
Compare
Choose a tag to compare

Changes

  • Remove old graph-build and graph-codegen executables.
  • Add graph auth <node> <access token> command that stores access tokens for nodes.
  • Use stored access tokens for nodes in graph deploy.
  • Rename --api-key option to --access-token.
  • README improvements
  • Test building mappings that use BigInt math.

v0.4.0

02 Nov 12:33
Compare
Choose a tag to compare

Changes

  • Generate AssemblyScript types from the GraphQL schema.
  • Validate subgraph manifest and GraphQL schema as part of graph codegen, graph build and graph deploy.
  • Make the subgraph.yaml argument optional.
  • Print GraphiQL and GraphQL endpoints after deploying a subgraph with graph deploy.
  • Add --debug and --verbose CLI flags.
  • Improve error output when subgraphs fail to load.
  • Show error when trying to run an unknown CLI command (e.g. graph foobarbaz).
  • Make console output more compact.
  • Make --watch mode more robust by catching subgraph manifest errors.
  • Add support for ABI compile output generated by newer versions of Truffle.
  • Streamline type conversions between Ethereum values, GraphQL/entity values and AssemblyScript.
  • Add test to build the example subgraph in Travis.
  • Test compiling all type conversions (Ethereum value <-> AssemblyScript, Entity attributes <-> AssemblyScript) in the example subgraph.
  • Set exit code to 1 if graph build or graph deploy fails.
  • Bump graph-ts dependency to v0.4.0.

Code generation for GraphQL schema

graph codegen now generates a schema.ts file in the output directory, with Entity subclasses for all entity types in the subgraph's GraphQL schema. You can then use these via

import { ParcelCreated . from /.types/Parcels/ParcelRegistry.ts`
import { Parcel } from './types/schema'

function handleParcelCreated(parcel: ParcelCreated) {
  let parcel = new Parcel()
  parcel.name = parcel.params.name
  parcel.owner = parcel.params.owner
  store.set('Parcel', parcel.params.parcelId.toHex(), parcel)
}

0.3.1

02 Oct 19:33
Compare
Choose a tag to compare
  • Fixes building subgraphs by passing a relative output filename to the AssemblyScript compiler.

0.3.0

02 Oct 10:31
Compare
Choose a tag to compare

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.

0.2.4

07 Sep 20:55
Compare
Choose a tag to compare

This release adds

  • a graph deploy command for deploying subgraphs to graph nodes,
  • a --watch flag for continuous building/deploying,
  • simplified store access with store.set etc. instead of having to use Store.bind first,
  • improvements to type conversions.

Developer Preview

06 Aug 18:30
Compare
Choose a tag to compare
Developer Preview Pre-release
Pre-release

This developer preview includes:

  • AssemblyScript mappings type and code generation
  • AssemblyScript mappings compilation
  • Compiling subgraph manifests
  • Deploying subgraph manifests to IPFS
  • Published as npm package