🤖 Powerful asynchronous state management, server-state utilities and data fetching for the web. TS/JS, React Query, Solid Query, Svelte Query and Vue Query.
import { queryOptions } from "@tanstack/vue-query"
import { computed } from "vue"
queryOptions({
queryKey: ["hello"],
queryFn: ({ queryKey }) => {
queryKey
// ^? (parameter) queryKey: string[]
}
})
queryOptions({
queryKey: computed(() => ["hello"]),
queryFn: ({ queryKey }) => {
queryKey
// ^? (parameter) queryKey: readonly unknown[]
// the type should be the same as in the first example without computed
}
})
I noticed this after upgrading to the latest version of vue-query (5.35.5) from 5.29.0
Describe the bug
I noticed this after upgrading to the latest version of vue-query (5.35.5) from 5.29.0
Your minimal, reproducible example
typescript playground reproduction
Tanstack Query adapter
vue-query
TanStack Query version
5.35.5
TypeScript version
5.4.5