You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Previously using store.set you could set non-existent fields on an entity. This is a determinism bug (depending on whether the entity is fetched from the cache or the store). This was fixed in graphprotocol/graph-node#4807. We should ideally catch this behaviour at build time, rather than failing at runtime.
The text was updated successfully, but these errors were encountered:
after some more thought and discussions internally. This is great idea, there are few ways we could go about and none of them are reasonable as of now:
At AssmeblyScript level if generic types were possible similar to how in TypeScript we can write some generics and let structural typings and rely on TS complier. But sadly we can't use the Typescript generics example I shared in AssemblyScript.
We can try to do this validation at a pre-build step. Which is computationally expensive and we will end up building our custom type checker which is much more involved project and not sure how much benefit there is given this is a rare case we are helping avoid developers
AssemblyScript doesn't have protected or private class members, that would have been simplest way where we force users to always use Entities and set values on the field instead of being able to call arbitrary .set() on an entity which could avoid lot of these issues.
Maybe if this becomes too big of an issue we should considerer re-opening and maybe by then there are some improvements in AssmeblyScript that we can build on top of.
Previously using
store.set
you could set non-existent fields on an entity. This is a determinism bug (depending on whether the entity is fetched from the cache or the store). This was fixed in graphprotocol/graph-node#4807. We should ideally catch this behaviour at build time, rather than failing at runtime.The text was updated successfully, but these errors were encountered: