-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
126 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ | |
"test": "yarn playwright test" | ||
}, | ||
"dependencies": { | ||
"@apollo/client": "^3.9.6", | ||
"@apollo/client": "npm:@apollo/[email protected]", | ||
"@apollo/experimental-nextjs-app-support": "workspace:*", | ||
"@apollo/server": "^4.9.5", | ||
"@as-integrations/next": "^3.0.0", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 1 addition & 7 deletions
8
.../rsc/dynamic/PreloadQuery/ClientChild.tsx → ...ery/queryRef-useReadQuery/ClientChild.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...src/app/rsc/dynamic/PreloadQuery/page.tsx → ...eloadQuery/queryRef-useReadQuery/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
integration-test/nextjs/src/app/rsc/dynamic/PreloadQuery/useSuspenseQuery/ClientChild.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
"use client"; | ||
|
||
import { useSuspenseQuery } from "@apollo/client"; | ||
import { QUERY } from "../shared"; | ||
|
||
export function ClientChild() { | ||
const { data } = useSuspenseQuery(QUERY); | ||
return ( | ||
<ul> | ||
{data.products.map(({ id, title }: any) => ( | ||
<li key={id}>{title}</li> | ||
))} | ||
</ul> | ||
); | ||
} |
29 changes: 29 additions & 0 deletions
29
integration-test/nextjs/src/app/rsc/dynamic/PreloadQuery/useSuspenseQuery/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { ApolloWrapper } from "@/app/cc/ApolloWrapper"; | ||
import { PreloadQuery } from "@apollo/client-react-streaming"; | ||
import { ClientChild } from "./ClientChild"; | ||
import { QUERY } from "../shared"; | ||
|
||
export const dynamic = "force-dynamic"; | ||
import { getClient } from "../../../client"; | ||
import { Suspense } from "react"; | ||
|
||
export default function Page({ searchParams }: { searchParams?: any }) { | ||
return ( | ||
<ApolloWrapper> | ||
<PreloadQuery | ||
options={{ | ||
query: QUERY, | ||
context: { | ||
delay: 1000, | ||
error: searchParams?.errorIn || undefined, | ||
}, | ||
}} | ||
getClient={getClient} | ||
> | ||
<Suspense fallback={<>loading</>}> | ||
<ClientChild /> | ||
</Suspense> | ||
</PreloadQuery> | ||
</ApolloWrapper> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,6 +44,43 @@ __metadata: | |
languageName: node | ||
linkType: hard | ||
|
||
"@apollo/client@npm:@apollo/[email protected]": | ||
version: 0.0.0-pr-11757-20240405111250 | ||
resolution: "@apollo/client@npm:0.0.0-pr-11757-20240405111250" | ||
dependencies: | ||
"@graphql-typed-document-node/core": "npm:^3.1.1" | ||
"@wry/caches": "npm:^1.0.0" | ||
"@wry/equality": "npm:^0.5.6" | ||
"@wry/trie": "npm:^0.5.0" | ||
graphql-tag: "npm:^2.12.6" | ||
hoist-non-react-statics: "npm:^3.3.2" | ||
optimism: "npm:^0.18.0" | ||
prop-types: "npm:^15.7.2" | ||
rehackt: "npm:0.0.6" | ||
response-iterator: "npm:^0.2.6" | ||
symbol-observable: "npm:^4.0.0" | ||
ts-invariant: "npm:^0.10.3" | ||
tslib: "npm:^2.3.0" | ||
zen-observable-ts: "npm:^1.2.5" | ||
peerDependencies: | ||
graphql: ^15.0.0 || ^16.0.0 | ||
graphql-ws: ^5.5.5 | ||
react: ^16.8.0 || ^17.0.0 || ^18.0.0 | ||
react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 | ||
subscriptions-transport-ws: ^0.9.0 || ^0.11.0 | ||
peerDependenciesMeta: | ||
graphql-ws: | ||
optional: true | ||
react: | ||
optional: true | ||
react-dom: | ||
optional: true | ||
subscriptions-transport-ws: | ||
optional: true | ||
checksum: 10/a9ff604e63042a1d40263d63f93ef823d84a23e716a310dc9491a22663512dd449e81583bbd677fe4b8b6ac10ec82254858705f32ebc21e4a669605bfadd09d3 | ||
languageName: node | ||
linkType: hard | ||
|
||
"@apollo/client@npm:^3.9.6": | ||
version: 3.9.6 | ||
resolution: "@apollo/client@npm:3.9.6" | ||
|
@@ -2026,7 +2063,7 @@ __metadata: | |
version: 0.0.0-use.local | ||
resolution: "@integration-test/nextjs@workspace:nextjs" | ||
dependencies: | ||
"@apollo/client": "npm:^3.9.6" | ||
"@apollo/client": "npm:@apollo/[email protected]" | ||
"@apollo/experimental-nextjs-app-support": "workspace:*" | ||
"@apollo/server": "npm:^4.9.5" | ||
"@as-integrations/next": "npm:^3.0.0" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters