The type of the data related to the key
The type of the data returned by the mutator
OptionalrevalidateWhether to revalidate the cache after mutation.
Can be a boolean or a function that receives the new data and key to determine whether revalidation should occur.
OptionalpopulateWhether and how to populate the cache with mutation results.
false: Don't update the cachetrue: Update cache with mutation result directlyOptionaloptimisticOptimistic data to show immediately while mutation is pending.
Can be the data directly or a function that computes it based on current and displayed data. Useful for immediate UI feedback.
OptionalrollbackWhether to rollback optimistic updates on error.
Can be a boolean or a function that receives the error to determine whether rollback should occur.
OptionalthrowWhether to throw errors instead of returning them in the error field.
When true, errors will be thrown and can be caught with try/catch. When false, errors are returned in the response object.
Options for configuring mutator behavior.
These options control how the mutation affects the cache, revalidation, and error handling behavior.