vue-query: UseQueryOptions no longer assignable to queryClient.query() since 5.103.0
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
- #12465 de @spaansba — cerrado sin fusionar
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- Medio día
- Aptitud para principiantes
- 67/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- typescript
- Área
- backend-api-design
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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().
- Lenguaje dominante
- TypeScript
- Estrellas
- 50.5k
- Forks
- 4.2k
- Merge medio
- 5 h 40 min
- PR fusionados (30 d)
- 574
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de TanStack/query
-
solid-query: STRICT_READ_UNTRACKED on Solid 2 — client()/options() read in component body (useMutation, useBaseQuery)Quizá libre de nuevo @LeonxLJX la tomó hace 57 días y no hay ningún pull request abierto. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
TanStack/query#11358 · 2 comentarios · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
[query-core] [performances] `setQueryData` dispatches a `success` event (and triggers broadcast/persist) even when the new data is structurally identical to the cached dataPosiblemente ocupada @praveen-kumary la tomó hace 1 día. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 52/100
Los mantenedores suelen responder en 1 día
-
refetchQueries with throwOnError leaves paused fetch rejection unhandled on client.clear()Posiblemente ocupada @lazerg la tomó hace 2 días. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 67/100
Los mantenedores suelen responder en 1 día
-
useBaseQuery fetches the old query key when an <Activity> tree is revealedPosiblemente ocupada @lazerg la tomó hace 10 días. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 35/100
Los mantenedores suelen responder en 1 día
-
[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 statePosiblemente ocupada @lazerg la tomó hace 10 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 25/100
Los mantenedores suelen responder en 1 día
Todos los issues de TanStack/query
Issues similares
-
area:cli bug P4
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
bug from-studio
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
esengine/DeepSeek-Reasonix#14868 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
loopbackio/loopback-next#11878 ·
Los mantenedores suelen responder en 2 días
-
bug 🐛
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
comunica/comunica#1925 · 1 comentario ·
Los mantenedores suelen responder en 1 día