Libraries to work with The Graph Networks Registry.
To update the types to match new schema version, run ./generate.sh. This will:
- pull the latest schema from networks-registry.thegraph.com,
- inject new version into libraries
- generate the types for all libraries using quicktype
- generate Go enum helpers using go-enum (see scripts/annotate-go-enums.awk)
- run tests and examples with the new schema
If there are errors when running the script, find and fix them manually.
Requires jq, Bun >= 1.4.3 (curl -fsSL https://bun.com/install | bash -s "bun-v1.4.3"), Node.js with npm (for the local TypeScript example), cargo and go. quicktype is pinned in the root package.json and installed from bun.lock, and go-enum in generate.sh (GO_ENUM_VERSION): newer quicktype versions change the generated type names and enums, which breaks the public API, so check the diff carefully before bumping them.
- Libraries are using semantic versioning
Major.Minor.Patch - Major and minor versions should match the schema version
- Patch version can be incremented independently with bug fixes
- Patch version is reset to 0 when schema version is changed
npm publish --forcefor TypeScript (--forcebecausepackage.jsonrequires Bun)cargo publishfor Rust./release.shfor Go