Skip to content

Commit cee4e66

Browse files
authored
docs: remove redundent imports (#346)
1 parent ee6c90e commit cee4e66

File tree

1 file changed

+4
-5
lines changed
  • packages/experimental-nextjs-app-support

1 file changed

+4
-5
lines changed

packages/experimental-nextjs-app-support/README.md

+4-5
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,11 @@ First, create a new file `app/ApolloWrapper.jsx`:
9191
"use client";
9292
// ^ this file needs the "use client" pragma
9393

94-
import { ApolloLink, HttpLink } from "@apollo/client";
94+
import { HttpLink } from "@apollo/client";
9595
import {
9696
ApolloNextAppProvider,
9797
ApolloClient,
9898
InMemoryCache,
99-
SSRMultipartLink,
10099
} from "@apollo/experimental-nextjs-app-support";
101100

102101
// have a function to create a client for you
@@ -202,7 +201,7 @@ That way, if you repeat the query in your Client Component using `useSuspenseQue
202201
> [!IMPORTANT]
203202
> 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`.
204203
205-
#### Usage with `useReadQuery`.
204+
#### Usage with `useReadQuery`
206205

207206
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:
208207

@@ -243,11 +242,11 @@ export function ClientChild({ queryRef }: { queryRef: QueryRef<TQueryData> }) {
243242

244243
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.
245244

246-
### Resetting singletons between tests.
245+
### Resetting singletons between tests
247246

248247
This package uses some singleton instances on the Browser side - if you are writing tests, you must reset them between tests.
249248

250-
For that, you can use the `resetApolloClientSingletons ` helper:
249+
For that, you can use the `resetApolloClientSingletons` helper:
251250

252251
```ts
253252
import { resetApolloClientSingletons } from "@apollo/experimental-nextjs-app-support";

0 commit comments

Comments
 (0)