Skip to content
Source
Sign inSign up
TanStack/query

isServer #10198

ClosedTkDodowants to merge 4 commits intomain fromfeature/isServeropened View on GitHub

Showing 29 changed files with 17 additions and 15 deletions (loading 26).

x
0 of 29 viewed, 29 left
10 additions and 0 deletionsdocs/reference/QueryClient.mdModified
View file
@@ -64,7 +64,17 @@
- Optional
- Define defaults for all queries and mutations using this queryClient.
- You can also define defaults to be used for [hydration](../framework/react/reference/hydration.md)
+- `isServer?: boolean`
+ - Optional
+ - Overrides environment detection for this client.
+ - Defaults to the exported `isServer` value from `@tanstack/query-core`.
+ - Use this when your runtime does not match the default detection.
​
+**Properties**
+​
+- `queryClient.isServer: boolean`
+ - The resolved server detection used by this `QueryClient` instance.
+​
## `queryClient.fetchQuery`
​
`fetchQuery` is an asynchronous method that can be used to fetch and cache a query. It will either resolve with the data or throw with the error. Use the `prefetchQuery` method if you just want to fetch a query without needing the result.
6 additions and 11 deletionspackages/preact-query/src/__tests__/ssr-hydration.test.tsxModified
View file
@@ -12,7 +12,6 @@
hydrate,