diff --git a/packages/svelte-query/src/createMutation.ts b/packages/svelte-query/src/createMutation.ts index 5997d8b2f0..97053fb0f4 100644 --- a/packages/svelte-query/src/createMutation.ts +++ b/packages/svelte-query/src/createMutation.ts @@ -6,6 +6,7 @@ import type { CreateMutateFunction, CreateMutationOptions, CreateMutationResult, + StoreOrVal, } from './types' import type { DefaultError, QueryClient } from '@tanstack/query-core' @@ -15,7 +16,9 @@ export function createMutation< TVariables = void, TContext = unknown, >( - options: CreateMutationOptions, + options: StoreOrVal< + CreateMutationOptions + >, queryClient?: QueryClient, ): CreateMutationResult { const client = useQueryClient(queryClient) diff --git a/packages/svelte-query/src/types.ts b/packages/svelte-query/src/types.ts index 032a312f95..4fd8bdb271 100644 --- a/packages/svelte-query/src/types.ts +++ b/packages/svelte-query/src/types.ts @@ -89,11 +89,9 @@ export type CreateMutationOptions< TError = DefaultError, TVariables = void, TContext = unknown, -> = StoreOrVal< - OmitKeyof< - MutationObserverOptions, - '_defaulted' - > +> = OmitKeyof< + MutationObserverOptions, + '_defaulted' > export type CreateMutateFunction<