Changes
- Generate AssemblyScript types from the GraphQL schema.
- Validate subgraph manifest and GraphQL schema as part of
graph codegen
,graph build
andgraph 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
ifgraph build
orgraph 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)
}