Skip to content

fix(cli): generate independent template factory classes - #2177

Open
yinbowen-dc wants to merge 1 commit into
graphprotocol:mainfrom
yinbowen-dc:codex/fix-2009-template-static-type
Open

yinbowen-dc wants to merge 1 commit into
graphprotocol:mainfrom
yinbowen-dc:codex/fix-2009-template-static-type

Conversation

@yinbowen-dc

Copy link
Copy Markdown

Generated template factories now type-check without TS2417: the template-specific create / createWithContext methods no longer override the incompatible static signatures on DataSourceTemplate.

Fixes #2009

The classes become standalone factories, while their method bodies still delegate to the same DataSourceTemplate host functions. Includes a CLI patch changeset.

Validation:

  • 94 codegen tests passed, including 9 new compiler tests for Ethereum, IPFS, and Arweave templates.
  • Each generated module is checked by TypeScript against the actual graph-ts source package; invalid create arguments are still rejected. The test environment supplies the AS 0.19 globals plus TypeScript's two standard function interfaces.
  • All three generated modules also compile to WebAssembly with the actual AssemblyScript compiler and graph-ts global module; imports for both data-source host calls are retained.
  • Before the fix, the 3 positive TypeScript checks fail with TS2417, while the 6 other controls pass.
  • Full CLI build, scoped ESLint/Prettier, and git diff --check passed.

Tests use an ignored local Vitest config without the unrelated network-dependent CLI linking/scaffold setup. No live deployment was performed.

Prepared with Codex AI assistance; no human review is claimed.

@changeset-bot

changeset-bot Bot commented Nov 19, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 999e4f0

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@graphprotocol/graph-cli Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Class static side incorrectly extends base class static side ' ... DataSourceTemplate'

1 participant