0
Fork 0
mirror of https://github.com/TanStack/query.git synced 2026-11-16 22:50:20 +00:00
query/docs/framework/react/reference/queryOptions.md
2026-08-20 11:32:10 +02:00

678 B

id title
queryOptions queryOptions
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. //: # 'Materials'

Further reading

To learn more about QueryOptions, have a look at this article by TkDodo The Query Options API.