Does returning values from an event handler makes the Subgraph to crash?

36 views Asked by At

I tried returning the entity objects from the event handlers on the AssemblyScript Subgraph code to simplify unit testing. For example, this works fine:

// Original code
export function handleEventCreation(
       event: EventCreation
): void {
...
}

but this fails:

// Failing code in Subgraph (it compiles well)
export function handleEventCreation(
     event: EventCreation,
): CreationEntity | null {
...
}

Both examples compile well.

Is there any explanation for that? In the Subgraph API site, I see that it failed indexing events only, but no further details about it.

0

There are 0 answers