vue-query: UseQueryOptions no longer assignable to queryClient.query() since 5.103.0
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 3/5
- Tempo estimado
- Meio dia
- Facilidade para iniciantes
- 67/100
- Tipo de issue
- Bug
- Clareza
- Claramente especificada
- Status de atividade
- Ativa
- Stack de tecnologia
- typescript
- Domínio
- backend-api-design
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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().
- Linguagem predominante
- TypeScript
- Estrelas
- 50.5k
- Forks
- 4.2k
- Merge médio
- 6h 27min
- PRs com merge (30d)
- 614
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de TanStack/query
-
solid-query: STRICT_READ_UNTRACKED on Solid 2 — client()/options() read in component body (useMutation, useBaseQuery)Talvez livre de novo @LeonxLJX assumiu há 56 dias e não há nenhum pull request aberto. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 84/100
TanStack/query#11358 · 2 comentários · 1 reação ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 52/100
Mantenedores costumam responder em até 1 dia
-
refetchQueries with throwOnError leaves paused fetch rejection unhandled on client.clear()Talvez já em andamento @lazerg assumiu há 1 dia. Aberta
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 67/100
Mantenedores costumam responder em até 1 dia
-
useBaseQuery fetches the old query key when an <Activity> tree is revealedTalvez já em andamento @lazerg assumiu há 9 dias. Aberta
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 35/100
Mantenedores costumam responder em até 1 dia
-
[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 stateTalvez já em andamento @lazerg assumiu há 9 dias. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 25/100
Mantenedores costumam responder em até 1 dia
Todas as issues de TanStack/query
Issues semelhantes
-
b:minor bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
software-mansion/argent#1698 ·
Mantenedores costumam responder em até 1 dia
-
e2e-failure ready-to-code
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
redhat-developer/rhdh-plugin-export-overlays#4624 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
better-auth/better-auth#12132 · 1 reação ·
Mantenedores costumam responder em até 1 dia
-
automation missing-model model-sync provider:tinfoil
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
anomalyco/models.dev#12053 ·
Mantenedores costumam responder em até 1 dia
-
o8 next debug build aborts on Glass to Dark appearance switch (nil identifier messaged before check)Abertabug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
hurttlocker/o8#5112 ·