Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/export-vue-mutation-result.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@tanstack/vue-query': patch
---

Export the `MutationResult` type so inferred `useMutation` return types can be named when emitting declarations
6 changes: 5 additions & 1 deletion packages/vue-query/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,11 @@ export type {
UseInfiniteQueryOptions,
UseInfiniteQueryReturnType,
} from './useInfiniteQuery'
export type { UseMutationOptions, UseMutationReturnType } from './useMutation'
export type {
MutationResult,
UseMutationOptions,
UseMutationReturnType,
} from './useMutation'
export type { MutationOptions } from './types'
export type { UseQueriesOptions, UseQueriesResults } from './useQueries'
export type {
Expand Down
2 changes: 1 addition & 1 deletion packages/vue-query/src/useMutation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import type {
import type { MaybeRefDeep, MutationOptions } from './types'
import type { QueryClient } from './queryClient'

type MutationResult<TData, TError, TVariables, TOnMutateResult> =
export type MutationResult<TData, TError, TVariables, TOnMutateResult> =
DistributiveOmit<
MutationObserverResult<TData, TError, TVariables, TOnMutateResult>,
'mutate' | 'reset'
Expand Down