Open
Description
Describe the bug
There seems to be a discrepancy between the return type of queryOptions
in vue query and react query adapters.
const options = queryOptions({
queryKey: ['groups'],
queryFn: () => []
})
useQuery(options)
options.queryFn
The actual options object seems to be okay: useQuery, fetchQuery, etc functions accept it and work just fine. But trying to access queryFn, placeholderData, etc throws a TS error
Property 'queryFn' does not exist on type 'UndefinedInitialQueryOptions<Group[], Error, Group[], string[]> & { queryKey: DataTag<string[], Group[]>; }'.
In fact, only queryKey and initialData properties are suggested in autocomplete. With react-query, all of the query options (queryFn, placeholderData, etc) are suggested.
Your minimal, reproducible example
Steps to reproduce
- Define query options using the
queryOptions
helper (with or without the initial data) - Try to access
queryOptions.queryFn
Expected behavior
I expected queryFn to be available but I'm getting a TS error: Property 'queryFn' does not exist on type UndefinedInitialQueryOptions<...>
How often does this bug happen?
Every time
Screenshots or Videos

Platform
Chrome 127.0.6533.100
Mac OS 10.15.7
Tanstack Query adapter
vue-query
TanStack Query version
v5.51.21
TypeScript version
v5.5.4
Additional context
No response