diff --git a/.changeset/pre.json b/.changeset/pre.json index f51bce71873..c29ab113f4a 100644 --- a/.changeset/pre.json +++ b/.changeset/pre.json @@ -12,6 +12,7 @@ "dirty-kids-crash", "forty-cups-shop", "friendly-clouds-laugh", + "fuzzy-eyes-lick", "hot-ducks-burn", "polite-avocados-warn", "quick-hats-marry", @@ -20,8 +21,11 @@ "sixty-boxes-rest", "sour-sheep-walk", "strong-terms-perform", + "swift-zoos-collect", "thick-mice-collect", + "thick-tips-cry", "thirty-ties-arrive", + "unlucky-rats-decide", "violet-lions-draw", "wild-dolphins-jog", "yellow-flies-repeat" diff --git a/CHANGELOG.md b/CHANGELOG.md index c7326ece2c7..02ab7e32556 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,39 @@ # @apollo/client +## 3.9.0-alpha.6 + +### Minor Changes + +- [#11397](https://github.com/apollographql/apollo-client/pull/11397) [`3f7eecb`](https://github.com/apollographql/apollo-client/commit/3f7eecbfbd4f4444cffcaac7dd9fd225c8c2a401) Thanks [@aditya-kumawat](https://github.com/aditya-kumawat)! - Adds a new `skipPollAttempt` callback function that's called whenever a refetch attempt occurs while polling. If the function returns `true`, the refetch is skipped and not reattempted until the next poll interval. This will solve the frequent use-case of disabling polling when the window is inactive. + + ```ts + useQuery(QUERY, { + pollInterval: 1000, + skipPollAttempt: () => document.hidden, // or !document.hasFocus() + }); + // or define it globally + new ApolloClient({ + defaultOptions: { + watchQuery: { + skipPollAttempt: () => document.hidden, // or !document.hasFocus() + }, + }, + }); + ``` + +### Patch Changes + +- [#11220](https://github.com/apollographql/apollo-client/pull/11220) [`865659b`](https://github.com/apollographql/apollo-client/commit/865659b879dc1458812df6718fdeb72f211ad496) Thanks [@benjamn](https://github.com/benjamn)! - Update react-native.md - Adds react native devtool in the documentation + +- [#11369](https://github.com/apollographql/apollo-client/pull/11369) [`2a47164`](https://github.com/apollographql/apollo-client/commit/2a471646616e3af1b5c039e961f8d5717fad8f32) Thanks [@phryneas](https://github.com/phryneas)! - Persisted Query Link: improve memory management + + - use LRU `WeakCache` instead of `WeakMap` to keep a limited number of hash results + - hash cache is initiated lazily, only when needed + - expose `persistedLink.resetHashCache()` method + - reset hash cache if the upstream server reports it doesn't accept persisted queries + +- [#10804](https://github.com/apollographql/apollo-client/pull/10804) [`221dd99`](https://github.com/apollographql/apollo-client/commit/221dd99ffd1990f8bd0392543af35e9b08d0fed8) Thanks [@phryneas](https://github.com/phryneas)! - use WeakMap in React Native with Hermes + ## 3.9.0-alpha.5 ### Minor Changes @@ -95,7 +129,7 @@ import { Environment, Network, RecordSource, Store } from "relay-runtime"; const fetchMultipartSubs = createFetchMultipartSubscription( - "http://localhost:4000" + "http://localhost:4000", ); const network = Network.create(fetchQuery, fetchMultipartSubs); @@ -377,7 +411,7 @@ return data.breeds.map(({ characteristics }) => characteristics.map((characteristic) => (
{characteristic}
- )) + )), ); } ``` @@ -428,7 +462,7 @@ const { data } = useSuspenseQuery( query, - id ? { variables: { id } } : skipToken + id ? { variables: { id } } : skipToken, ); ``` @@ -2383,7 +2417,7 @@ In upcoming v3.6.x and v3.7 (beta) releases, we will be completely overhauling o fields: { comments(comments: Reference[], { readField }) { return comments.filter( - (comment) => idToRemove !== readField("id", comment) + (comment) => idToRemove !== readField("id", comment), ); }, }, diff --git a/package-lock.json b/package-lock.json index a2a88bf002e..57e892d1403 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@apollo/client", - "version": "3.9.0-alpha.5", + "version": "3.9.0-alpha.6", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@apollo/client", - "version": "3.9.0-alpha.5", + "version": "3.9.0-alpha.6", "hasInstallScript": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index f99c1a6cdd9..05e495a6850 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@apollo/client", - "version": "3.9.0-alpha.5", + "version": "3.9.0-alpha.6", "description": "A fully-featured caching GraphQL client.", "private": true, "keywords": [