Framework
Version
Menu
Getting Started
Guides & Concepts
API Reference
ESLint
Community Resources
Examples
Plugins

queryOptions

tsx
queryOptions({
  queryKey,
  ...options,
})
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
    • Required
    • The query key to generate options for.
Want to Skip the Docs?
Query.gg - The Official React Query Course
“This course is the best way to learn how to use React Query in real-world applications.”—Tanner Linsley
Check it out