You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
description: 'Generate fully typed TanStack/React Query v5 hooks from an OpenAPI 3.1 spec, with Zod v4 runtime validation and an end-to-end pipeline (client, mocks, server).',
Copy file name to clipboardExpand all lines: docs/framework/angular/devtools.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,9 +5,9 @@ title: Devtools
5
5
6
6
> For Chrome, Firefox, and Edge users: Third-party browser extensions are available for debugging TanStack Query directly in browser DevTools. These provide the same functionality as the framework-specific devtools packages:
7
7
>
8
-
> - <imgalt="Chrome logo"src="https://www.google.com/chrome/static/images/chrome-logo.svg"width="16"height="16"class="inline mr-1 not-prose" /> [Devtools for Chrome](https://chromewebstore.google.com/detail/tanstack-query-devtools/annajfchloimdhceglpgglpeepfghfai)
9
-
> - <imgalt="Firefox logo"src="https://upload.wikimedia.org/wikipedia/commons/a/a0/Firefox_logo%2C_2019.svg"width="16"height="16"class="inline mr-1 not-prose" /> [Devtools for Firefox](https://addons.mozilla.org/en-US/firefox/addon/tanstack-query-devtools/)
10
-
> - <imgalt="Edge logo"src="https://upload.wikimedia.org/wikipedia/commons/9/98/Microsoft_Edge_logo_%282019%29.svg"width="16"height="16"class="inline mr-1 not-prose" /> [Devtools for Edge](https://microsoftedge.microsoft.com/addons/detail/tanstack-query-devtools/edmdpkgkacmjopodhfolmphdenmddobj)
8
+
> - <imgalt="Chrome logo"src="https://www.google.com/chrome/static/images/chrome-logo.svg"width="16"height="16"class="inline mr-1 not-prose" /> <ahref="https://chromewebstore.google.com/detail/tanstack-query-devtools/annajfchloimdhceglpgglpeepfghfai">Devtools for Chrome</a>
9
+
> - <imgalt="Firefox logo"src="https://upload.wikimedia.org/wikipedia/commons/a/a0/Firefox_logo%2C_2019.svg"width="16"height="16"class="inline mr-1 not-prose" /> <ahref="https://addons.mozilla.org/en-US/firefox/addon/tanstack-query-devtools/">Devtools for Firefox</a>
10
+
> - <imgalt="Edge logo"src="https://upload.wikimedia.org/wikipedia/commons/9/98/Microsoft_Edge_logo_%282019%29.svg"width="16"height="16"class="inline mr-1 not-prose" /> <ahref="https://microsoftedge.microsoft.com/addons/detail/tanstack-query-devtools/edmdpkgkacmjopodhfolmphdenmddobj">Devtools for Edge</a>
Copy file name to clipboardExpand all lines: docs/framework/preact/devtools.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,9 +9,9 @@ When you begin your Preact Query journey, you'll want these devtools by your sid
9
9
10
10
> For Chrome, Firefox, and Edge users: Third-party browser extensions are available for debugging TanStack Query directly in browser DevTools. These provide the same functionality as the framework-specific devtools packages:
11
11
>
12
-
> - <imgalt="Chrome logo"src="https://www.google.com/chrome/static/images/chrome-logo.svg"width="16"height="16"class="inline mr-1 not-prose" /> [Devtools for Chrome](https://chromewebstore.google.com/detail/tanstack-query-devtools/annajfchloimdhceglpgglpeepfghfai)
13
-
> - <imgalt="Firefox logo"src="https://upload.wikimedia.org/wikipedia/commons/a/a0/Firefox_logo%2C_2019.svg"width="16"height="16"class="inline mr-1 not-prose" /> [Devtools for Firefox](https://addons.mozilla.org/en-US/firefox/addon/tanstack-query-devtools/)
14
-
> - <imgalt="Edge logo"src="https://upload.wikimedia.org/wikipedia/commons/9/98/Microsoft_Edge_logo_%282019%29.svg"width="16"height="16"class="inline mr-1 not-prose" /> [Devtools for Edge](https://microsoftedge.microsoft.com/addons/detail/tanstack-query-devtools/edmdpkgkacmjopodhfolmphdenmddobj)
12
+
> - <imgalt="Chrome logo"src="https://www.google.com/chrome/static/images/chrome-logo.svg"width="16"height="16"class="inline mr-1 not-prose" /> <ahref="https://chromewebstore.google.com/detail/tanstack-query-devtools/annajfchloimdhceglpgglpeepfghfai">Devtools for Chrome</a>
13
+
> - <imgalt="Firefox logo"src="https://upload.wikimedia.org/wikipedia/commons/a/a0/Firefox_logo%2C_2019.svg"width="16"height="16"class="inline mr-1 not-prose" /> <ahref="https://addons.mozilla.org/en-US/firefox/addon/tanstack-query-devtools/">Devtools for Firefox</a>
14
+
> - <imgalt="Edge logo"src="https://upload.wikimedia.org/wikipedia/commons/9/98/Microsoft_Edge_logo_%282019%29.svg"width="16"height="16"class="inline mr-1 not-prose" /> <ahref="https://microsoftedge.microsoft.com/addons/detail/tanstack-query-devtools/edmdpkgkacmjopodhfolmphdenmddobj">Devtools for Edge</a>
Copy file name to clipboardExpand all lines: docs/framework/react/devtools.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,9 +9,9 @@ When you begin your React Query journey, you'll want these devtools by your side
9
9
10
10
> For Chrome, Firefox, and Edge users: Third-party browser extensions are available for debugging TanStack Query directly in browser DevTools. These provide the same functionality as the framework-specific devtools packages:
11
11
>
12
-
> - <imgalt="Chrome logo"src="https://www.google.com/chrome/static/images/chrome-logo.svg"width="16"height="16"class="inline mr-1 not-prose" /> [Devtools for Chrome](https://chromewebstore.google.com/detail/tanstack-query-devtools/annajfchloimdhceglpgglpeepfghfai)
13
-
> - <imgalt="Firefox logo"src="https://upload.wikimedia.org/wikipedia/commons/a/a0/Firefox_logo%2C_2019.svg"width="16"height="16"class="inline mr-1 not-prose" /> [Devtools for Firefox](https://addons.mozilla.org/en-US/firefox/addon/tanstack-query-devtools/)
14
-
> - <imgalt="Edge logo"src="https://upload.wikimedia.org/wikipedia/commons/9/98/Microsoft_Edge_logo_%282019%29.svg"width="16"height="16"class="inline mr-1 not-prose" /> [Devtools for Edge](https://microsoftedge.microsoft.com/addons/detail/tanstack-query-devtools/edmdpkgkacmjopodhfolmphdenmddobj)
12
+
> - <imgalt="Chrome logo"src="https://www.google.com/chrome/static/images/chrome-logo.svg"width="16"height="16"class="inline mr-1 not-prose" /> <ahref="https://chromewebstore.google.com/detail/tanstack-query-devtools/annajfchloimdhceglpgglpeepfghfai">Devtools for Chrome</a>
13
+
> - <imgalt="Firefox logo"src="https://upload.wikimedia.org/wikipedia/commons/a/a0/Firefox_logo%2C_2019.svg"width="16"height="16"class="inline mr-1 not-prose" /> <ahref="https://addons.mozilla.org/en-US/firefox/addon/tanstack-query-devtools/">Devtools for Firefox</a>
14
+
> - <imgalt="Edge logo"src="https://upload.wikimedia.org/wikipedia/commons/9/98/Microsoft_Edge_logo_%282019%29.svg"width="16"height="16"class="inline mr-1 not-prose" /> <ahref="https://microsoftedge.microsoft.com/addons/detail/tanstack-query-devtools/edmdpkgkacmjopodhfolmphdenmddobj">Devtools for Edge</a>
15
15
16
16
> For React Native users: A third-party native macOS app is available for debugging React Query in ANY js-based application. Monitor queries across devices in real-time. Check it out here: [rn-better-dev-tools](https://github.com/LovesWorking/rn-better-dev-tools)
Copy file name to clipboardExpand all lines: docs/framework/react/guides/parallel-queries.md
+5Lines changed: 5 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -56,3 +56,8 @@ function App({ users }) {
56
56
```
57
57
58
58
[//]: #'Example2'
59
+
[//]: #'TypeScriptSelect'
60
+
61
+
> When using TypeScript, an inline `select` written on a query object passed to `useQueries` can't infer its `data` argument from that same object's `queryFn` — it falls back to `unknown`. Annotate the `select` parameter explicitly, or define the query with the [`queryOptions`](../reference/queryOptions.md) helper, to keep type inference. See [this known limitation](https://github.com/TanStack/query/issues/6556).
Copy file name to clipboardExpand all lines: docs/framework/react/reference/useQueries.md
+78Lines changed: 78 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -65,3 +65,81 @@ The `combine` function will only re-run if:
65
65
- any of the query results changed
66
66
67
67
This means that an inlined `combine` function, as shown above, will run on every render. To avoid this, you can wrap the `combine` function in `useCallback`, or extract it to a stable function reference if it doesn't have any dependencies.
68
+
69
+
## TypeScript: typing the `select` option
70
+
71
+
Unlike `useQuery`, `useQueries` cannot infer the `data` argument of an _inline_`select` from its sibling `queryFn`. Because `useQueries` infers the type of the whole `queries` array at once, the `select` parameter of a query object written inline cannot be contextually typed from that same object's `queryFn`, so it falls back to `unknown`. This is a [known TypeScript limitation](https://github.com/TanStack/query/issues/6556).
72
+
73
+
```tsx
74
+
useQueries({
75
+
queries: [
76
+
{
77
+
queryKey: ['post', 1],
78
+
queryFn: () =>fetchPost(1),
79
+
// ❌ `data` is `unknown` here
80
+
select: (data) =>data.title,
81
+
},
82
+
],
83
+
})
84
+
```
85
+
86
+
There are two supported workarounds:
87
+
88
+
1. Annotate the `select` parameter explicitly:
89
+
90
+
```tsx
91
+
useQueries({
92
+
queries: [
93
+
{
94
+
queryKey: ['post', 1],
95
+
queryFn: () =>fetchPost(1),
96
+
// ✅ `data` is `Post`
97
+
select: (data:Post) =>data.title,
98
+
},
99
+
],
100
+
})
101
+
```
102
+
103
+
2. Define the query with the [`queryOptions`](./queryOptions.md) helper, which resolves its types in a single object _before_ it reaches `useQueries`:
The same limitation applies when you spread a `queryOptions` result to override its `select` inline — the overriding `select` still falls back to `unknown`:
118
+
119
+
```tsx
120
+
useQueries({
121
+
queries: [
122
+
{
123
+
...postOptions(1),
124
+
// ❌ `data` is `unknown` here
125
+
select: (data) =>data.title,
126
+
},
127
+
],
128
+
})
129
+
```
130
+
131
+
Wrap the spread in `queryOptions` again so the override is resolved before it reaches `useQueries`:
132
+
133
+
```tsx
134
+
useQueries({
135
+
queries: [
136
+
queryOptions({
137
+
...postOptions(1),
138
+
// ✅ `data` is `Post`
139
+
select: (data) =>data.title,
140
+
}),
141
+
],
142
+
})
143
+
```
144
+
145
+
The same applies to [`useSuspenseQueries`](./useSuspenseQueries.md).
0 commit comments