-
Notifications
You must be signed in to change notification settings - Fork 43
Adds support for useBackgroundQuery and useReadQuery in Streaming SSR
#38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 20 commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
814e92d
wip
alessbell dca3d81
wip 2
alessbell 3a21252
wip 3
alessbell 433171b
ensure rehydration context is injected
phryneas ca132ac
prevent accidental early bailout
phryneas 305f0b7
enforce object identity for multiple queries with the same printed te…
phryneas 01f320c
enable debug logging, update import
phryneas 8d38550
naive data transport logic without cleanup
phryneas 9a8a967
feat: set fetchCancelFn for fake query
alessbell b9ffce2
chore: update examples, error pages, README.md
alessbell 388813a
chore: merge main
alessbell a0c75a8
chore: use beta 3 everywhere
alessbell 7f9c7af
chore: fix double import and add ts-ignores for now
alessbell 789fc54
fix: review feedback
alessbell 9a74dc6
fixes: use printedServerQuery to lookup in flight observable,
alessbell c49d481
- Move call to resolveFakeQueries.get inside fetchCancelFn.
alessbell bfb789d
chore: prettier formatting
alessbell 702daa2
Merge remote-tracking branch 'origin/main' into useBackgroundQuery-us…
alessbell 037c8ba
chore: add ApolloBackgroundQueryTransport to test helpers
alessbell fa82b94
fix: call this.resolveFakeQueries in finally handler
alessbell ed78947
chore: use beta 4
alessbell 867d581
fix: remove ts-ignores in hooks.ts
alessbell 6462b2a
fix: call cleanupCancelFn in finally block
alessbell File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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 |
|---|---|---|
| @@ -1,5 +1,11 @@ | ||
| "use client"; | ||
|
|
||
| export default function Error(error: { toString(): string }) { | ||
| return <p>Error: {error.toString()}</p>; | ||
| export default function Error({ | ||
| error, | ||
| reset, | ||
| }: { | ||
| error: Error; | ||
| reset: () => void; | ||
| }) { | ||
| return <p>Error: {error.message}</p>; | ||
| } |
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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 |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| import { Poll } from "./poll-cc"; | ||
| import { PollWrapper } from "./poll-cc"; | ||
|
|
||
| export const dynamic = "force-dynamic"; | ||
|
|
||
| export default async function Home() { | ||
| return <Poll />; | ||
| return <PollWrapper />; | ||
| } |
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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,7 +44,7 @@ | |
| }, | ||
| "packageManager": "[email protected]", | ||
| "devDependencies": { | ||
| "@apollo/client": ">=3.8.0-beta.2", | ||
| "@apollo/client": ">=3.8.0-beta.3", | ||
| "@total-typescript/shoehorn": "^0.1.0", | ||
| "@tsconfig/recommended": "^1.0.1", | ||
| "@typescript-eslint/eslint-plugin": "latest", | ||
|
|
@@ -59,7 +59,7 @@ | |
| "vitest": "^0.30.1" | ||
| }, | ||
| "peerDependencies": { | ||
| "@apollo/client": ">=3.8.0-beta.2", | ||
| "@apollo/client": ">=3.8.0-beta.3", | ||
| "next": "^13.4.1", | ||
| "react": "^18" | ||
| }, | ||
|
|
||
This file contains hidden or 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 |
|---|---|---|
| @@ -1,14 +1,22 @@ | ||
| import { SuperJSONResult } from "superjson/dist/types"; | ||
| import { RehydrationCache, ResultsCache } from "./types"; | ||
| import { | ||
| RehydrationCache, | ||
| ResultsCache, | ||
| BackgroundQueriesCache, | ||
| } from "./types"; | ||
| import type { DataTransport } from "./dataTransport"; | ||
|
|
||
| declare global { | ||
| interface Window { | ||
| [ApolloRehydrationCache]?: RehydrationCache; | ||
| [ApolloResultCache]?: ResultsCache; | ||
| [ApolloSSRDataTransport]?: DataTransport<SuperJSONResult>; | ||
| [ApolloBackgroundQueryTransport]?: BackgroundQueriesCache; | ||
| } | ||
| } | ||
| export const ApolloRehydrationCache = Symbol.for("ApolloRehydrationCache"); | ||
| export const ApolloResultCache = Symbol.for("ApolloResultCache"); | ||
| export const ApolloSSRDataTransport = Symbol.for("ApolloSSRDataTransport"); | ||
| export const ApolloBackgroundQueryTransport = Symbol.for( | ||
| "ApolloBackgroundQueryTransport" | ||
| ); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.