Skip to content

Commit

Permalink
Fix missing getServerSnapshot function for useSubscription (#11980)
Browse files Browse the repository at this point in the history
  • Loading branch information
jerelmiller committed Jul 31, 2024
1 parent 07693a2 commit 38c0a2c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/wet-shirts-juggle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@apollo/client": patch
---

Fix missing `getServerSnapshot` error when using `useSubscription` on the server.
2 changes: 1 addition & 1 deletion .size-limits.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"dist/apollo-client.min.cjs": 40164,
"dist/apollo-client.min.cjs": 40168,
"import { ApolloClient, InMemoryCache, HttpLink } from \"dist/index.js\" (production)": 32974
}
3 changes: 2 additions & 1 deletion src/react/hooks/useSubscription.ts
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,8 @@ export function useSubscription<
() =>
observable && !skip && !ignoreResults ?
observable.__.result
: fallbackResult
: fallbackResult,
() => fallbackResult
);
return React.useMemo(
() => ({
Expand Down

0 comments on commit 38c0a2c

Please sign in to comment.