feat(query-core): make `MutateFunction` optional undefinable-variables
Old Behavior:
.mutate, .mutateAsync, ... allowed omitting the variables parameter only when its type was exactly void.
However, in TypeScript, when using union types like unknown | void, the void portion is ignored and treated as unknown, which still requires that variables be provided.
New Behavior:
.mutate, .mutateAsync, ... now allow omitting the variables parameter when its type can be undefined.
This change significantly broadens the optional types, supporting cases such as unknown, any, undefined | ..., void | ..., ...
Another benefit of the new approach is that, for popular schema libraries like Zod and Valibot, it is easier to define an undefinable schema than a void-able one.
bump
View your CI Pipeline Execution ↗ for commit 01b77b48d8f9729d1acbe81bea63834b4a66a88a.
| Command | Status | Duration | Result |
|---|---|---|---|
nx affected --targets=test:sherif,test:knip,tes... |
❌ Failed | 2m 55s | View ↗ |
nx run-many --target=build --exclude=examples/*... |
❌ Failed | 1m 15s | View ↗ |
☁️ Nx Cloud last updated this comment at 2025-03-05 14:47:53 UTC
there are type errors now in other adapters