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
@@ -202,7 +201,7 @@ That way, if you repeat the query in your Client Component using `useSuspenseQue
202
201
> [!IMPORTANT]
203
202
> Keep in mind that we don't recommend mixing data between Client Components and Server Components. Data fetched this way should be considered client data and never be referenced in your Server Components. `PreloadQuery` prevents mixing server data and client data by creating a separate `ApolloClient` instance using the `makeClient` function passed into `registerApolloClient`.
204
203
205
-
#### Usage with `useReadQuery`.
204
+
#### Usage with `useReadQuery`
206
205
207
206
Just like using `useBackgroundQuery` with `useReadQuery` in place of `useSuspenseQuery`[to avoid request waterfalls](https://www.apollographql.com/docs/react/data/suspense#avoiding-request-waterfalls), you can also use `PreloadQuery` in combination with `useReadQuery` in Client Components to achieve a similar result. Use the render prop notation to get a `QueryRef` that you can pass to your Client Component:
Keep in mind that this will look like a "current network request" to your Client Component and as such will update data that is already in your Client Component cache, so make sure that the data you pass from your Server Components is not outdated, e.g. because of other caching layers you might be using, like the Next.js fetch cache.
245
244
246
-
### Resetting singletons between tests.
245
+
### Resetting singletons between tests
247
246
248
247
This package uses some singleton instances on the Browser side - if you are writing tests, you must reset them between tests.
249
248
250
-
For that, you can use the `resetApolloClientSingletons` helper:
249
+
For that, you can use the `resetApolloClientSingletons` helper:
0 commit comments