queryOptions({
queryKey,
...options,
})
Options
You can generally pass everything to queryOptions that you can also pass to useQuery. Some options will have no effect when then forwarded to a function like queryClient.prefetchQuery, but TypeScript will still be fine with those excess properties.
queryKey: QueryKey
experimental_prefetchInRender?: boolean
falsetrue, queries will be prefetched during render, which can be useful for certain optimization scenariosuseQuery().promise functionalityTo learn more about QueryOptions, have a look at this article by TkDodo The Query Options API.
