Minor Changes
-
#12959
556e837
Thanks @jerelmiller! - You can now provide a callback function as thecontext
option on themutate
function returned byuseMutation
. The callback function is called with the value of thecontext
option provided to theuseMutation
hook. This is useful if you'd like to merge the context object provided to theuseMutation
hook with a value provided to themutate
function.function MyComponent() { const [mutate, result] = useMutation(MUTATION, { context: { foo: true }, }); async function runMutation() { await mutate({ // sends context as { foo: true, bar: true } context: (hookContext) => ({ ...hookContext, bar: true }), }); } // ... }
Patch Changes
- #12954
1c82eaf
Thanks @jerelmiller! - Ensure an error is thrown when@stream
is detected and anincrementalDelivery
handler is not configured.