vue-query: UseQueryOptions no longer assignable to queryClient.query() since 5.103.0
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 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分
- マージ済み PR(30日)
- 614
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
TanStack/query のほかの issue
-
solid-query: STRICT_READ_UNTRACKED on Solid 2 — client()/options() read in component body (useMutation, useBaseQuery)再び着手できるかも @LeonxLJX が 56 日前に担当しましたが、オープン中のプルリクエストはありません。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
TanStack/query#11358 · コメント 2 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
[query-core] [performances] `setQueryData` dispatches a `success` event (and triggers broadcast/persist) even when the new data is structurally identical to the cached data対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 52/100
メンテナーはふだん 1 日以内に返信
-
refetchQueries with throwOnError leaves paused fetch rejection unhandled on client.clear()対応中かも @lazerg が 2 日前に担当しました。 オープン
難易度 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 が 10 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 25/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
bug ready-for-agent
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
PhyberApex/kuroshiro#1687 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
microsoft/monaco-editor#5563 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 1/5 1時間未満 初心者へのやさしさ 86/100
awslabs/visual-asset-management-system#937 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100