vue-query: UseQueryOptions no longer assignable to queryClient.query() since 5.103.0
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 半天
- 新手友好度
- 67/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- typescript
调研方向
Start with the QueryClient overloads for query() and the deprecated prefetchQuery / fetchQuery in the Vue Query adapter, then compare their MaybeRefDeep<...> query function types with UseQueryOptions and the SkipTokenForUseQuery change from #11439. Reproduce the TS2769 error using the issue’s snippet with TypeScript 6.0.3 and Vue Query 5.103.0 or newer. Done when the annotated UseQueryOptions<number> is accepted by these methods and the reported regression is covered by a type check.
由索引模型根据 Issue 内容生成。
描述
Describe the bug
Since 5.103.0, a value typed as UseQueryOptions is no longer accepted by queryClient.query(). It fails with TS2769. The deprecated prefetchQuery / fetchQuery fail the same way.
#11439 added type SkipTokenForUseQuery = symbol to queryFn in UseQueryOptions. The MaybeRefDeep<...> overloads on QueryClient still expect typeof skipToken, so a plain symbol no longer fits. Options inferred through queryOptions() are fine. Only values annotated or cast as UseQueryOptions break, which is what code generators emit.
Your minimal, reproducible example
Steps to reproduce
import { QueryClient, type UseQueryOptions } from '@tanstack/vue-query'
declare const options: UseQueryOptions<number>
const queryClient = new QueryClient()
// Compiles on 5.102.0, TS2769 since 5.103.0
void queryClient.query(options)
- Install
@tanstack/[email protected]or newer - Type-check the snippet
- See TS2769
Expected behavior
A UseQueryOptions value is accepted by queryClient.query(), as in 5.102.0.
How often does this bug happen?
Every time
Platform
Type-check only (tsc / vue-tsc), macOS
Tanstack Query adapter
vue-query
TanStack Query version
v5.103.0 (still present in v5.105.0)
TypeScript version
v6.0.3
Additional context
Found through Orval's generated vue-query prefetch*Query helpers, which cast their options to UseQueryOptions before calling queryClient.query().
- 主要语言
- TypeScript
- 星标
- 50.5k
- 派生
- 4.2k
- 平均合并
- 6 小时 27 分钟
- 30 天内合并 PR
- 614
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
TanStack/query 的其他 Issue
-
solid-query: STRICT_READ_UNTRACKED on Solid 2 — client()/options() read in component body (useMutation, useBaseQuery)可能重新可做 @LeonxLJX 于 56 天前认领,目前没有进行中的 PR。 未关闭
难度 2/5 1-3 小时 新手友好度 84/100
TanStack/query#11358 · 2 条评论 · 1 个 reaction ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 52/100
维护者通常 1 天内回复
-
refetchQueries with throwOnError leaves paused fetch rejection unhandled on client.clear()可能已有人在做 @lazerg 于 1 天前认领。 未关闭
难度 3/5 1-2 天 新手友好度 67/100
维护者通常 1 天内回复
-
useBaseQuery fetches the old query key when an <Activity> tree is revealed可能已有人在做 @lazerg 于 9 天前认领。 未关闭
难度 3/5 1-2 天 新手友好度 35/100
维护者通常 1 天内回复
-
[query-broadcast-client-experimental] broadcastQueryClient: an `added` event overwrites a receiving query that has no data (e.g. in error) with the sender's empty state可能已有人在做 @lazerg 于 9 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 25/100
维护者通常 1 天内回复
相似的 Issue
-
area:desktop area:ui bug platform:macos
难度 2/5 1-3 小时 新手友好度 67/100
anthropics/claude-code#106183 ·
维护者通常 1 天内回复
-
难度 1/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
feature:App-Tour feature:Chat ready Web
难度 2/5 1-3 小时 新手友好度 62/100
digitalfabrik/integreat-app#4523 · 2 个 reaction ·
维护者通常 3 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
Required Lexical field accepts two empty paragraphs可能已有人在做 @lazerg 今天认领。 未关闭Bug
难度 2/5 1-3 小时 新手友好度 76/100
payloadcms/payload#19222 ·
维护者通常 1 天内回复