Problem Statement
How do mutation hooks work differently from query hooks in RTK Query?
Explanation
Mutation hooks like useCreatePostMutation return a tuple with a trigger function as the first element and a result object as the second, unlike query hooks that automatically fetch on mount. You call the trigger function manually when needed like onClick handlers passing the mutation argument, and the trigger returns a promise allowing you to await the result or use then and catch. The result object provides the same isLoading, isSuccess, isError, data, and error properties as query hooks, plus a reset function to clear the mutation state, but mutations don't cache results by default and must be explicitly triggered rather than running automatically.
