Conditionals on mutation status should narrow the type of data. For example,
mutation.status === 'success' && mutation.data
mutation.data can not be undefined after the guard, but the type doesn't reflect this. The object returned by useQuery does support narrowing like this, so useMutation should too.