Wrapper for useSWRMutation

Author: jkjustjoshingCreated Jun 30, 2025Updated Aug 6, 2026
Labelsenhancementswr-openapi

Description

I'm trying to migrate to swr-openapi. I use useSWRMutation(), and specifically am using the isMutating flag on the return value.

Since swr-openapi doesn't expose a useSWRMutation() hook equivalent, what's the correct way to use the isMutating flag using the hooks that are exposed?

Proposal

If this is not possible at the moment, I'd like a new hook creator function that wraps useSWRMutation(), and exposes the isMutating flag.

Extra

Source: openapi-ts/openapi-typescript