Releases: graphprotocol/graph-tooling
v0.19.0
- Add support for CLI plugins (e.g.
graph indexer ...
). graph init
: Add contract name support.graph test
: Speed updocker-compose down
.graph test
: Makedocker-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
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
v0.17.0
v0.16.2
v0.16.1
v0.16.0
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 samenetwork
value. - Dependency updates (glob, tern, jayson, graphql, yaml, eslint).