Skip to content

Check eventHandler defined in subgraph.yaml exists in compiled wasm #1475

Closed
@KholdStare

Description

@KholdStare

Which packages are impacted by your issue?

@graphprotocol/graph-cli

Describe the issue

Currently it is possible to mention a non-existent function as the handler for an event in the manifest. graph build will run fine, but running the actual subgraph will break at runtime, the first time the event fires that needs to call that handler.

The build step should check if the ts file or wasm have the function defined.

Reproduction

NA

Steps to Reproduce the Bug or Issue

  1. Create a manifest that handles an event but does not have the handler defined.
  2. Deploy it and have the subgraph break with an error

Expected behavior

The build command should catch cases where the hander is missing.

Screenshots or Videos

No response

Platform

  • OS: Linux
  • NodeJS: 18.17.1
  • "@graphprotocol/graph-cli": "^0.59.0"

Subgraph Manifest

No response

Subgraph GraphQL Schema

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    ✅ Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions