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
Handle GraphQL nulls from "optional" fields as undefined
GraphQL's / Nest's decorators have `nullable` option,
which means the value can be null or omitted.
Which naturally translates to null or undefined in JS.
We actually care about this distinction, though, especially on update mutations.
undefined means no change.
null means clear the value.
We carelessly allowed both meaningly that nulls could mistakenly be stored in lots of spots that are unexpected.
Granted, this only would happen in Neo4j, as Gel's schema checks would prevent this.
Going forward we have a new `optional` option as a sibling to `nullable`.
`optional` lets the field be omitted or undefined. GraphQL can still give us nulls, but be will we convert them to undefined.
`nullable` continues to let null & undefined through.
0 commit comments