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
Copy file name to clipboardExpand all lines: apps/docs/docs/react-query.mdx
+73Lines changed: 73 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -200,3 +200,76 @@ return (
200
200
</div>
201
201
);
202
202
```
203
+
204
+
## QueryClient Helpers
205
+
206
+
In addition to the hooks provided, `@ts-rest/react-query` also provides a custom hook `useTsRestQueryClient` with wrapper functions around some `QueryClient` functions to help invoke the API as well as provide some typing.
Functions such as `invalidateQueries` that neither exchange typed data nor invoke the API have no benefit of being wrapped. Therefore, call these functions directly through your `QueryClient` instance.
269
+
270
+
:::info
271
+
272
+
Functions that may throw on failure such as `fetchQuery` will throw an error if the request fails or returns a non-2xx response.
0 commit comments