Skip to content

Releases: graphprotocol/graph-tooling

v0.19.0

13 Oct 16:26
Compare
Choose a tag to compare
  • Add support for CLI plugins (e.g. graph indexer ...).
  • graph init: Add contract name support.
  • graph test: Speed up docker-compose down.
  • graph test: Make docker-compose kill optional (depending on the system).
  • Allow deriving from interface-typed fields.
  • Allow specifying a graft base in the manifest.
  • Fix Value is not a XYZ errors for null values.
  • Fix path lookups in compiler script (thanks @fubhy!).
  • Add support for yarn workspaces and otherwise hoisted node modules (thanks
    @fubhy!).
  • Fix validating call handlers for functions with tuple parameters (#500).
  • Properly unfold tuple event/call parameters in signatures.
  • Pass --debug to AssemblyScript compiler.
  • Dependency updates: acorn, fs-extra, yaml, docker-compose, gluegun, jest.

v0.18.0

08 Apr 12:07
Compare
Choose a tag to compare

Feature: graph test (#414, #420, #421)

This release introduces a new graph test command that can be used to run test commands against a (customizable) test environment (by default: Graph Node, Postgres, IPFS and Ganache in Docker Compose).

This essentially provides a framework for writing integration tests, where a subgraph is indexed against a fresh Graph node, tests can wait for it to synced, run queries at specific blocks and so on.

graph test [options] <test-command>

Options:

  -h, --help                    Show usage information
      --compose-file <file>     Custom Docker Compose file for additional services (optional)
      --node-image <image>      Custom Graph Node image to test against (default: graphprotocol/graph-node:latest)
      --standalone-node <cmd>   Use a standalone Graph Node outside Docker Compose (optional)
      --standalone-node-args    Custom arguments to be passed to the standalone Graph Node (optional)
      --skip-wait-for-ipfs      Don't wait for IPFS to be up at localhost:5001 (optional)
      --skip-wait-for-ethereum  Don't wait for Ethereum to be up at localhost:8545 (optional)
      --skip-wait-for-postgres  Don't wait for Postgres to be up at localhost:5432 (optional)
      --node-logs               Print the Graph Node logs (optional)

The <test-command> can be anything: it can be a shell script that builds and deploys a subgraph, it can be a JS test suite run with Jest or it can be a Truffle test suite, run with truffle test.

Overriding the --node-image allows to use a custom build of Graph Node, which is useful for running integration tests for specific versions of Graph Node.

Overriding the --compose-file allows to e.g. use a different Ethereum provider than the default Ganache, making it possible to test subgraphs against mainnet for instance.

Misc

  • Fix codegen for tuple arrays (#455 via #456). Thanks @JamesLefrere!
  • Add createWithContext() code generation for data source templates (#446).
  • Fix building in situations where subgraph.yaml is not in the working directory (#443).
  • Add validation for new @fulltext directive (#433).
  • Fix URL not being defined in older Node.js versions (#422).
  • Add auto-migration from apiVersion 0.0.3 to 0.0.4 (#418).
  • Fix Entity field getters for nullable fields (#417).
  • Add support for overloaded Ethereum contract functions (#415).
  • Update code generation to dedicated ethereum module in graph-ts (#409).
  • Dependency updates: docker-compose, handlebars, jest, tern, keytar, request.

v0.17.1

23 Dec 12:36
Compare
Choose a tag to compare
  • Bump @graphprotocol/graph-ts to v0.17.0.

v0.17.0

23 Dec 11:51
Compare
Choose a tag to compare
  • Fix type conversion from AssemblyScript to Ethereum's uint{8,16,24} (#398)
  • Dependency updates: chalk, chokidar, eslint, glob, gluegun, jayson, prettier, strip-ansi.

v0.16.2

13 Nov 19:38
Compare
Choose a tag to compare
  • Speed up graph build / graph deploy by only compiling identical mappings once (#394).
  • Speed up uploading to IPFS in graph build --ipfs ... and graph deploy by only uploading identical files once (#393 via #394).

v0.16.1

12 Nov 10:11
Compare
Choose a tag to compare
  • Add --network poa-core support to graph init (#383).
  • Bump graph-ts version in scaffold generated by graph init to 0.16.0.

v0.16.0

01 Nov 12:32
Compare
Choose a tag to compare

Start block for data sources

Until now, subgraphs were always indexing from the genesis block. This involved scanning the entire chain for relevant blocks, logs and traces, even if the subgraph contracts were only deployed recently.

This was fine initially. However, with more expensive features—such as block and call handlers—being added and more advanced subgraphs being developed, it has often become desirable to skip irrelevant old blocks entirely to speed up indexing.

This is now possible. As of this release, data sources can specify an optional startBlock number in the manifest:

dataSources:
  - name: Gravity
    source:
      address: '0x2E645469f354BB4F5c8a05B3b30A929361cf77eC'
      abi: Gravity
      startBlock: 6000000

The subgraph will then start indexing from this block. If there are multiple data sources with or without start blocks, the earliest of these blocks is used as the starting point. The absence of a startBlock is equivalent to 0 (aka the genesis block).

Other changes

  • Fix exit codes used in graph deploy command.
  • Validate data source network fields. Data sources (and templates) must either have no network set or they must all use the same network value.
  • Dependency updates (glob, tern, jayson, graphql, yaml, eslint).

v0.15.3

22 Oct 08:50
Compare
Choose a tag to compare
  • Remove local code that was accidentally included in v0.15.2.

v0.15.2

17 Oct 17:16
Compare
Choose a tag to compare
  • Fix identifying the subgraph source directory, going upwards from subgraph.yaml (#365).

v0.15.1

04 Oct 16:25
Compare
Choose a tag to compare
  • Catch non-unique data source names (#352).
  • Do not assume that source directory and working directory are the same (#360).