Open History to see the last commit
1---
2id: queryOptions
3title: queryOptions
4---
5β
6```tsx
7queryOptions({
8 queryKey,
9 ...options,
10})
11```
12β
13**Options**
14β
15You can generally pass everything to `queryOptions` that you can also pass to [`useQuery`](../useQuery.md). 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.
16β
17- `queryKey: QueryKey`
18 - **Required**
19 - The query key to generate options for.
20- `experimental_prefetchInRender?: boolean`
21 - Optional
22 - Defaults to `false`
23 - When set to `true`, queries will be prefetched during render, which can be useful for certain optimization scenarios
24 - Needs to be turned on for the experimental `useQuery().promise` functionality
25β
26[//]: # 'Materials'
27β
28## Further reading
29β
30To learn more about `QueryOptions`, have a look at [The Query Options API](../../community/tkdodos-blog.md#24-the-query-options-api) from the Community Resources.
31β
32[//]: # 'Materials'