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
Describe the bug
If a hook sets a value that doesn't exist on the entity, the code succeeds in execution, but the result is not what the developer expects.
From Slack: The code in BeforeCreateHook for SustainabilityAttribute was supposed to set { organization: { id: 'org_##########' } } but in my haste, I accidentally told it to set { organization_id: 'org_##########' } } (the field is named organization_id in the db). In order to debug it, I have to set breakpoints in your code to see what's happening since the error returned isn't really helpful. It would be nice if it gave us something like invalid field: organization_id on entity SustainabilityAttribute .
Expected behavior
In development, we should validate that the fields set by hooks are real fields. In production we should not do this check unless explicitly enabled as it will have performance implications.
Actual behavior
Code runs without error, result is not what developer expected.
Describe the bug
If a hook sets a value that doesn't exist on the entity, the code succeeds in execution, but the result is not what the developer expects.
Expected behavior
In development, we should validate that the fields set by hooks are real fields. In production we should not do this check unless explicitly enabled as it will have performance implications.
Actual behavior
Code runs without error, result is not what developer expected.
Additional context
https://graphweaver.slack.com/archives/D0730MYM74Z/p1726103546839589?thread_ts=1723672001.215299&cid=D0730MYM74Z
The text was updated successfully, but these errors were encountered: