Skip to content
Source
Sign inSign up
TanStack/query
Open History to see the last commit

queryOptions.md

26 lines603 Bytes

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). These options can be shared across hooks and imperative APIs such as `queryClient.query`.
16​
17- `queryKey: QueryKey`
18 - **Required**
19 - The query key to generate options for.
20[//]: # 'Materials'
21​
22## Further reading
23​
24To learn more about `QueryOptions`, have a look at [this article by TkDodo The Query Options API](https://tkdodo.eu/blog/the-query-options-api).
25​
26[//]: # 'Materials'