Skip to content

Lesson 15 : Subgraph mapping error #4888

Discussion options

You must be logged in to vote

Hi @NicolasMazzoleni. These errors in the subgraph logs can sometimes be quite enigmatic.

In the code for handleItemListed in src/nft-marketplace.ts, it seems like there was an unexpected null entity. Which is weird because you made sure to load the activeItem, or create it if it doesn't exist.

Except that there is a little issue right here in your code, line 62:

 if (!activeItem) {
  new ActiveItem(getIdFromEventParams(event.params.tokenId, event.params.nft))
} 

See how the newly created ActiveItem is never assigned to the variable activeItem? I believe it's just a typo, as you did it correctly in the other functions.

Let me know if it works correctly after that.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@NicolasMazzoleni
Comment options

@0xpolarzero
Comment options

Answer selected by NicolasMazzoleni
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants