From b0b72a36d02e66078a67104a8fb5713abb56d72a Mon Sep 17 00:00:00 2001 From: Manan Telrandhe Date: Wed, 22 Jul 2026 21:33:32 +0530 Subject: [PATCH 1/3] fix(vue-query): unwrap getter function for fetchQuery options --- packages/vue-query/src/queryClient.ts | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/packages/vue-query/src/queryClient.ts b/packages/vue-query/src/queryClient.ts index b9f78e26c17..a49c2b70d15 100644 --- a/packages/vue-query/src/queryClient.ts +++ b/packages/vue-query/src/queryClient.ts @@ -212,11 +212,14 @@ export class QueryClient extends QC { | (() => InvalidateQueryFilters) = {}, options: MaybeRefDeep | (() => InvalidateOptions) = {}, ): Promise { + const unwrappedFilters = typeof filters === 'function' ? filters() : filters + const unwrappedOptions = typeof options === 'function' ? options() : options + const filtersCloned = cloneDeepUnref( - filters as MaybeRefDeep>, + unwrappedFilters as MaybeRefDeep>, ) const optionsCloned = cloneDeepUnref( - options as MaybeRefDeep, + unwrappedOptions as MaybeRefDeep, ) super.invalidateQueries( @@ -301,11 +304,20 @@ export class QueryClient extends QC { TQueryKey extends QueryKey = QueryKey, TPageParam = never, >( - options: MaybeRefDeep< - FetchQueryOptions - >, + options: + | MaybeRefDeep< + FetchQueryOptions + > + | (() => FetchQueryOptions< + TQueryFnData, + TError, + TData, + TQueryKey, + TPageParam + >), ): Promise { - return super.fetchQuery(cloneDeepUnref(options)) + const unwrappedOptions = typeof options === 'function' ? options() : options + return super.fetchQuery(cloneDeepUnref(unwrappedOptions as any)) } prefetchQuery< From 10ac8bb510e4fef9eeea9f10b7da7d63d363d074 Mon Sep 17 00:00:00 2001 From: Manan Telrandhe Date: Wed, 22 Jul 2026 23:10:08 +0530 Subject: [PATCH 2/3] fix(vue-query): widen getter overload return types to MaybeRefDeep --- packages/vue-query/src/queryClient.ts | 50 ++++++++++++++++----------- 1 file changed, 30 insertions(+), 20 deletions(-) diff --git a/packages/vue-query/src/queryClient.ts b/packages/vue-query/src/queryClient.ts index a49c2b70d15..64550ccf35a 100644 --- a/packages/vue-query/src/queryClient.ts +++ b/packages/vue-query/src/queryClient.ts @@ -202,15 +202,19 @@ export class QueryClient extends QC { TInferredError = InferErrorFromTag, >( filters?: - | InvalidateQueryFilters - | (() => InvalidateQueryFilters), - options?: MaybeRefDeep, + | MaybeRefDeep> + | (() => MaybeRefDeep>), + options?: + | MaybeRefDeep + | (() => MaybeRefDeep), ): Promise invalidateQueries( filters: | MaybeRefDeep> - | (() => InvalidateQueryFilters) = {}, - options: MaybeRefDeep | (() => InvalidateOptions) = {}, + | (() => MaybeRefDeep>) = {}, + options: + | MaybeRefDeep + | (() => MaybeRefDeep) = {}, ): Promise { const unwrappedFilters = typeof filters === 'function' ? filters() : filters const unwrappedOptions = typeof options === 'function' ? options() : options @@ -289,13 +293,16 @@ export class QueryClient extends QC { | MaybeRefDeep< FetchQueryOptions > - | (() => FetchQueryOptions< - TQueryFnData, - TError, - TData, - TQueryKey, - TPageParam - >), + | (() => + MaybeRefDeep< + FetchQueryOptions< + TQueryFnData, + TError, + TData, + TQueryKey, + TPageParam + > + >), ): Promise fetchQuery< TQueryFnData, @@ -308,16 +315,19 @@ export class QueryClient extends QC { | MaybeRefDeep< FetchQueryOptions > - | (() => FetchQueryOptions< - TQueryFnData, - TError, - TData, - TQueryKey, - TPageParam - >), + | (() => + MaybeRefDeep< + FetchQueryOptions< + TQueryFnData, + TError, + TData, + TQueryKey, + TPageParam + > + >), ): Promise { const unwrappedOptions = typeof options === 'function' ? options() : options - return super.fetchQuery(cloneDeepUnref(unwrappedOptions as any)) + return super.fetchQuery(cloneDeepUnref(unwrappedOptions)) } prefetchQuery< From 15aefa9d7218fefabe7bf44c039e502e71503555 Mon Sep 17 00:00:00 2001 From: Manan Telrandhe Date: Wed, 22 Jul 2026 23:39:12 +0530 Subject: [PATCH 3/3] fix(examples): use webpack in Next.js examples for StackBlitz compatibility --- examples/react/auto-refetching/package.json | 2 +- examples/react/infinite-query-with-max-pages/package.json | 2 +- examples/react/load-more-infinite-scroll/package.json | 2 +- examples/react/nextjs-app-prefetching/package.json | 2 +- examples/react/nextjs/package.json | 2 +- examples/react/optimistic-updates-cache/package.json | 2 +- examples/react/optimistic-updates-ui/package.json | 2 +- examples/react/pagination/package.json | 2 +- examples/react/prefetching/package.json | 2 +- integrations/react-next-15/package.json | 2 +- integrations/react-next-16/package.json | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/examples/react/auto-refetching/package.json b/examples/react/auto-refetching/package.json index 0f850a9d061..0d0aac9f594 100644 --- a/examples/react/auto-refetching/package.json +++ b/examples/react/auto-refetching/package.json @@ -3,7 +3,7 @@ "private": true, "type": "module", "scripts": { - "dev": "next", + "dev": "next dev --webpack", "build": "next build", "start": "next start" }, diff --git a/examples/react/infinite-query-with-max-pages/package.json b/examples/react/infinite-query-with-max-pages/package.json index 3dcd817efaa..678dd9107a3 100644 --- a/examples/react/infinite-query-with-max-pages/package.json +++ b/examples/react/infinite-query-with-max-pages/package.json @@ -3,7 +3,7 @@ "private": true, "type": "module", "scripts": { - "dev": "next", + "dev": "next dev --webpack", "build": "next build", "start": "next start" }, diff --git a/examples/react/load-more-infinite-scroll/package.json b/examples/react/load-more-infinite-scroll/package.json index 323f6923627..dd6a7618936 100644 --- a/examples/react/load-more-infinite-scroll/package.json +++ b/examples/react/load-more-infinite-scroll/package.json @@ -3,7 +3,7 @@ "private": true, "type": "module", "scripts": { - "dev": "next", + "dev": "next dev --webpack", "build": "next build", "start": "next start" }, diff --git a/examples/react/nextjs-app-prefetching/package.json b/examples/react/nextjs-app-prefetching/package.json index 7b1086cd985..2a0e0002a50 100644 --- a/examples/react/nextjs-app-prefetching/package.json +++ b/examples/react/nextjs-app-prefetching/package.json @@ -3,7 +3,7 @@ "private": true, "type": "module", "scripts": { - "dev": "next dev", + "dev": "next dev --webpack", "build": "next build", "start": "next start" }, diff --git a/examples/react/nextjs/package.json b/examples/react/nextjs/package.json index d1170e05fdc..49095faaa74 100644 --- a/examples/react/nextjs/package.json +++ b/examples/react/nextjs/package.json @@ -3,7 +3,7 @@ "private": true, "type": "module", "scripts": { - "dev": "next", + "dev": "next dev --webpack", "build": "next build", "start": "next start" }, diff --git a/examples/react/optimistic-updates-cache/package.json b/examples/react/optimistic-updates-cache/package.json index ec228f4d294..6c4d32eff2c 100755 --- a/examples/react/optimistic-updates-cache/package.json +++ b/examples/react/optimistic-updates-cache/package.json @@ -3,7 +3,7 @@ "private": true, "type": "module", "scripts": { - "dev": "next", + "dev": "next dev --webpack", "build": "next build", "start": "next start" }, diff --git a/examples/react/optimistic-updates-ui/package.json b/examples/react/optimistic-updates-ui/package.json index 51e9ba16a8c..b11943b0a67 100755 --- a/examples/react/optimistic-updates-ui/package.json +++ b/examples/react/optimistic-updates-ui/package.json @@ -3,7 +3,7 @@ "private": true, "type": "module", "scripts": { - "dev": "next", + "dev": "next dev --webpack", "build": "next build", "start": "next start" }, diff --git a/examples/react/pagination/package.json b/examples/react/pagination/package.json index c44d3855a42..2777f684ffd 100644 --- a/examples/react/pagination/package.json +++ b/examples/react/pagination/package.json @@ -3,7 +3,7 @@ "private": true, "type": "module", "scripts": { - "dev": "next", + "dev": "next dev --webpack", "build": "next build", "start": "next start" }, diff --git a/examples/react/prefetching/package.json b/examples/react/prefetching/package.json index a9336403b36..1f98bd901bd 100644 --- a/examples/react/prefetching/package.json +++ b/examples/react/prefetching/package.json @@ -3,7 +3,7 @@ "private": true, "type": "module", "scripts": { - "dev": "next", + "dev": "next dev --webpack", "build": "next build", "start": "next start" }, diff --git a/integrations/react-next-15/package.json b/integrations/react-next-15/package.json index 1454aa61a4e..67d96978d4d 100644 --- a/integrations/react-next-15/package.json +++ b/integrations/react-next-15/package.json @@ -2,7 +2,7 @@ "name": "react-next-15", "private": true, "scripts": { - "dev": "next dev", + "dev": "next dev --webpack", "build": "next build" }, "dependencies": { diff --git a/integrations/react-next-16/package.json b/integrations/react-next-16/package.json index e0f4e0f8530..6be1a3cd693 100644 --- a/integrations/react-next-16/package.json +++ b/integrations/react-next-16/package.json @@ -2,7 +2,7 @@ "name": "react-next-16", "private": true, "scripts": { - "dev": "next dev", + "dev": "next dev --webpack", "build": "next build" }, "dependencies": {