Skip to content

fix(cli): validate handlers in template and cached mappings - #2172

Open
yinbowen-dc wants to merge 1 commit into
graphprotocol:mainfrom
yinbowen-dc:codex/fix-2065-template-handler-validation
Open

yinbowen-dc wants to merge 1 commit into
graphprotocol:mainfrom
yinbowen-dc:codex/fix-2065-template-handler-validation

Conversation

@yinbowen-dc

Copy link
Copy Markdown

Fixes #2065.

graph build checks handler exports for data sources but not templates. Also, a cached mapping returns before checking the handlers requested by the current manifest entry. Propagate the validation flag to templates and check both newly compiled and cached WASM outputs for each entry.

Regression tests use a real small WASM module with a known function export and a mocked AssemblyScript compilation boundary. They cover missing handlers in fresh/cached templates and cached data sources, valid cache reuse, and explicitly disabled validation. Three tests fail against the original compiler; all five pass with this change. Includes a patch changeset.

Validation: compiler regression tests; CLI source TypeScript build; ESLint and Prettier on changed files. The full project tsc --noEmit currently also includes an existing add-command fixture whose generated Gravity/schema imports are absent in a fresh checkout; that command was not green and is not claimed as passing.

Prepared with AI assistance.

@changeset-bot

changeset-bot Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: a935bab

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

@yinbowen-dc
yinbowen-dc force-pushed the codex/fix-2065-template-handler-validation branch from 9f13cdc to a935bab Compare November 18, 2026 09:27
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.

"Missing handlers in WASM" error is not triggered for "templates" section

1 participant