From e121a475211e89562cdc9371519dc243eb6c96fc Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 2 Aug 2023 15:21:06 +0000 Subject: [PATCH] Version Packages --- .changeset/afraid-zebras-punch.md | 24 --- .changeset/calm-bears-buy.md | 5 - .changeset/chatty-experts-fly.md | 20 -- .changeset/cold-comics-sleep.md | 5 - .changeset/cold-tips-accept.md | 9 - .changeset/cool-dogs-applaud.md | 5 - .changeset/curvy-dragons-talk.md | 5 - .changeset/curvy-monkeys-kneel.md | 5 - .changeset/cyan-insects-love.md | 5 - .changeset/cyan-sloths-grin.md | 5 - .changeset/dry-crabs-thank.md | 5 - .changeset/dry-tools-chew.md | 5 - .changeset/dull-snakes-turn.md | 5 - .changeset/early-days-stare.md | 52 ----- .changeset/early-pens-retire.md | 5 - .changeset/early-pumpkins-type.md | 5 - .changeset/famous-ladybugs-reflect.md | 5 - .changeset/fast-tomatoes-peel.md | 5 - .changeset/friendly-mugs-repeat.md | 5 - .changeset/funny-peas-change.md | 5 - .changeset/grumpy-tips-know.md | 5 - .changeset/heavy-ties-sneeze.md | 5 - .changeset/honest-ads-act.md | 5 - .changeset/hungry-chairs-live.md | 17 -- .changeset/hungry-eagles-kick.md | 5 - .changeset/itchy-bulldogs-help.md | 6 - .changeset/large-beers-rhyme.md | 5 - .changeset/lazy-teachers-sell.md | 5 - .changeset/lemon-fans-shake.md | 5 - .changeset/light-ravens-wait.md | 5 - .changeset/little-schools-roll.md | 5 - .changeset/mean-tigers-thank.md | 5 - .changeset/modern-peaches-marry.md | 5 - .changeset/neat-rockets-sleep.md | 9 - .changeset/nice-eyes-return.md | 5 - .changeset/nine-boxes-happen.md | 5 - .changeset/odd-pumpkins-care.md | 5 - .changeset/odd-students-crash.md | 5 - .changeset/old-moles-run.md | 5 - .changeset/olive-pans-report.md | 5 - .changeset/orange-suns-check.md | 5 - .changeset/polite-birds-rescue.md | 5 - .changeset/polite-pianos-kiss.md | 5 - .changeset/popular-beers-move.md | 5 - .changeset/rude-frogs-destroy.md | 5 - .changeset/rude-mayflies-scream.md | 5 - .changeset/seven-needles-remember.md | 5 - .changeset/seven-onions-burn.md | 5 - .changeset/sharp-trees-cough.md | 5 - .changeset/short-bikes-mate.md | 5 - .changeset/short-feet-relax.md | 5 - .changeset/short-monkeys-love.md | 5 - .changeset/silent-eagles-check.md | 7 - .changeset/silver-radios-chew.md | 5 - .changeset/sixty-trains-sniff.md | 5 - .changeset/small-pots-applaud.md | 12 -- .changeset/small-timers-shake.md | 5 - .changeset/small-tomatoes-explode.md | 5 - .changeset/smooth-clouds-sort.md | 5 - .changeset/smooth-forks-shop.md | 5 - .changeset/smooth-goats-cheat.md | 10 - .changeset/sour-weeks-suffer.md | 9 - .changeset/spotty-news-stare.md | 5 - .changeset/strange-drinks-report.md | 5 - .changeset/tame-owls-lick.md | 5 - .changeset/tasty-wasps-relate.md | 5 - .changeset/ten-cherries-clap.md | 5 - .changeset/three-grapes-marry.md | 5 - .changeset/twelve-files-promise.md | 5 - .changeset/warm-pandas-cry.md | 20 -- .changeset/wild-mice-nail.md | 5 - CHANGELOG.md | 291 ++++++++++++++++++++++++++ package-lock.json | 4 +- package.json | 2 +- 74 files changed, 294 insertions(+), 493 deletions(-) delete mode 100644 .changeset/afraid-zebras-punch.md delete mode 100644 .changeset/calm-bears-buy.md delete mode 100644 .changeset/chatty-experts-fly.md delete mode 100644 .changeset/cold-comics-sleep.md delete mode 100644 .changeset/cold-tips-accept.md delete mode 100644 .changeset/cool-dogs-applaud.md delete mode 100644 .changeset/curvy-dragons-talk.md delete mode 100644 .changeset/curvy-monkeys-kneel.md delete mode 100644 .changeset/cyan-insects-love.md delete mode 100644 .changeset/cyan-sloths-grin.md delete mode 100644 .changeset/dry-crabs-thank.md delete mode 100644 .changeset/dry-tools-chew.md delete mode 100644 .changeset/dull-snakes-turn.md delete mode 100644 .changeset/early-days-stare.md delete mode 100644 .changeset/early-pens-retire.md delete mode 100644 .changeset/early-pumpkins-type.md delete mode 100644 .changeset/famous-ladybugs-reflect.md delete mode 100644 .changeset/fast-tomatoes-peel.md delete mode 100644 .changeset/friendly-mugs-repeat.md delete mode 100644 .changeset/funny-peas-change.md delete mode 100644 .changeset/grumpy-tips-know.md delete mode 100644 .changeset/heavy-ties-sneeze.md delete mode 100644 .changeset/honest-ads-act.md delete mode 100644 .changeset/hungry-chairs-live.md delete mode 100644 .changeset/hungry-eagles-kick.md delete mode 100644 .changeset/itchy-bulldogs-help.md delete mode 100644 .changeset/large-beers-rhyme.md delete mode 100644 .changeset/lazy-teachers-sell.md delete mode 100644 .changeset/lemon-fans-shake.md delete mode 100644 .changeset/light-ravens-wait.md delete mode 100644 .changeset/little-schools-roll.md delete mode 100644 .changeset/mean-tigers-thank.md delete mode 100644 .changeset/modern-peaches-marry.md delete mode 100644 .changeset/neat-rockets-sleep.md delete mode 100644 .changeset/nice-eyes-return.md delete mode 100644 .changeset/nine-boxes-happen.md delete mode 100644 .changeset/odd-pumpkins-care.md delete mode 100644 .changeset/odd-students-crash.md delete mode 100644 .changeset/old-moles-run.md delete mode 100644 .changeset/olive-pans-report.md delete mode 100644 .changeset/orange-suns-check.md delete mode 100644 .changeset/polite-birds-rescue.md delete mode 100644 .changeset/polite-pianos-kiss.md delete mode 100644 .changeset/popular-beers-move.md delete mode 100644 .changeset/rude-frogs-destroy.md delete mode 100644 .changeset/rude-mayflies-scream.md delete mode 100644 .changeset/seven-needles-remember.md delete mode 100644 .changeset/seven-onions-burn.md delete mode 100644 .changeset/sharp-trees-cough.md delete mode 100644 .changeset/short-bikes-mate.md delete mode 100644 .changeset/short-feet-relax.md delete mode 100644 .changeset/short-monkeys-love.md delete mode 100644 .changeset/silent-eagles-check.md delete mode 100644 .changeset/silver-radios-chew.md delete mode 100644 .changeset/sixty-trains-sniff.md delete mode 100644 .changeset/small-pots-applaud.md delete mode 100644 .changeset/small-timers-shake.md delete mode 100644 .changeset/small-tomatoes-explode.md delete mode 100644 .changeset/smooth-clouds-sort.md delete mode 100644 .changeset/smooth-forks-shop.md delete mode 100644 .changeset/smooth-goats-cheat.md delete mode 100644 .changeset/sour-weeks-suffer.md delete mode 100644 .changeset/spotty-news-stare.md delete mode 100644 .changeset/strange-drinks-report.md delete mode 100644 .changeset/tame-owls-lick.md delete mode 100644 .changeset/tasty-wasps-relate.md delete mode 100644 .changeset/ten-cherries-clap.md delete mode 100644 .changeset/three-grapes-marry.md delete mode 100644 .changeset/twelve-files-promise.md delete mode 100644 .changeset/warm-pandas-cry.md delete mode 100644 .changeset/wild-mice-nail.md diff --git a/.changeset/afraid-zebras-punch.md b/.changeset/afraid-zebras-punch.md deleted file mode 100644 index 8869d5b5934..00000000000 --- a/.changeset/afraid-zebras-punch.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -"@apollo/client": minor ---- - -Add generic type parameter for the entity modified in `cache.modify`. Improves -TypeScript type inference for that type's fields and values of those fields. - -Example: - -```ts -cache.modify({ - id: cache.identify(someBook), - fields: { - title: (title) => { - // title has type `string`. - // It used to be `any`. - }, - author: (author) => { - // author has type `Reference | Book["author"]`. - // It used to be `any`. - }, - }, -}); -``` diff --git a/.changeset/calm-bears-buy.md b/.changeset/calm-bears-buy.md deleted file mode 100644 index 0db701bbc5b..00000000000 --- a/.changeset/calm-bears-buy.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@apollo/client': patch ---- - -Fix an issue where a call to `refetch`, `fetchMore`, or changing `skip` to `false` that returned a result deeply equal to data in the cache would get stuck in a pending state and never resolve. diff --git a/.changeset/chatty-experts-fly.md b/.changeset/chatty-experts-fly.md deleted file mode 100644 index abbc7fa7238..00000000000 --- a/.changeset/chatty-experts-fly.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -'@apollo/client': patch ---- - -Add `SuspenseCache` as a lazy hidden property on ApolloClient. -This means that `SuspenseCache` is now an implementation details of Apollo Client -and you no longer need to manually instantiate it and no longer need to pass it -into `ApolloProvider`. -Trying to instantiate a `SuspenseCache` instance in your code will now throw an -error. - -Migration: -```diff --import { SuspenseCache } from '@apollo/client'; - --const suspenseCache = new SuspenseCache(); - --; -+; -``` \ No newline at end of file diff --git a/.changeset/cold-comics-sleep.md b/.changeset/cold-comics-sleep.md deleted file mode 100644 index 9d8aabf5c9f..00000000000 --- a/.changeset/cold-comics-sleep.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@apollo/client': patch ---- - -Enforce `export type` for all type-level exports. diff --git a/.changeset/cold-tips-accept.md b/.changeset/cold-tips-accept.md deleted file mode 100644 index 0e8775403a9..00000000000 --- a/.changeset/cold-tips-accept.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -"@apollo/client": minor ---- - -Use unique opaque types for the `DELETE` and `INVALIDATE` Apollo cache modifiers. - -This increases type safety, since these 2 modifiers no longer have the `any` type. -Moreover, it no longer triggers [the `@typescript-eslint/no-unsafe-return` -rule](https://typescript-eslint.io/rules/no-unsafe-return/). diff --git a/.changeset/cool-dogs-applaud.md b/.changeset/cool-dogs-applaud.md deleted file mode 100644 index 796c7d8e825..00000000000 --- a/.changeset/cool-dogs-applaud.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@apollo/client': patch ---- - -Prevents the DevTool installation warning to be turned into a documentation link. diff --git a/.changeset/curvy-dragons-talk.md b/.changeset/curvy-dragons-talk.md deleted file mode 100644 index 1013f27de28..00000000000 --- a/.changeset/curvy-dragons-talk.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@apollo/client': patch ---- - -Add a `suspenseCache` option to `useSuspenseQuery` diff --git a/.changeset/curvy-monkeys-kneel.md b/.changeset/curvy-monkeys-kneel.md deleted file mode 100644 index 219c3b1f78c..00000000000 --- a/.changeset/curvy-monkeys-kneel.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@apollo/client': patch ---- - -Add a `queryKey` option to `useSuspenseQuery` that allows the hook to create a unique subscription instance. diff --git a/.changeset/cyan-insects-love.md b/.changeset/cyan-insects-love.md deleted file mode 100644 index 6250c7d510d..00000000000 --- a/.changeset/cyan-insects-love.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@apollo/client': patch ---- - -Automatically strips `__typename` fields from `variables` sent to the server when using [`HttpLink`](https://www.apollographql.com/docs/react/api/link/apollo-link-http), [`BatchHttpLink`](https://www.apollographql.com/docs/react/api/link/apollo-link-batch-http), or [`GraphQLWsLink`](https://www.apollographql.com/docs/react/api/link/apollo-link-subscriptions). This allows GraphQL data returned from a query to be used as an argument to a subsequent GraphQL operation without the need to strip the `__typename` in user-space. diff --git a/.changeset/cyan-sloths-grin.md b/.changeset/cyan-sloths-grin.md deleted file mode 100644 index 57af41c0f1d..00000000000 --- a/.changeset/cyan-sloths-grin.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@apollo/client': patch ---- - -Use `React.version` as key for shared Contexts. diff --git a/.changeset/dry-crabs-thank.md b/.changeset/dry-crabs-thank.md deleted file mode 100644 index 44b58542b68..00000000000 --- a/.changeset/dry-crabs-thank.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@apollo/client': patch ---- - -Fix an issue where cache updates would not propagate to `useSuspenseQuery` while in strict mode. diff --git a/.changeset/dry-tools-chew.md b/.changeset/dry-tools-chew.md deleted file mode 100644 index 98b820c96f0..00000000000 --- a/.changeset/dry-tools-chew.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@apollo/client': patch ---- - -Make private fields `inFlightLinkObservables` and `fetchCancelFns` protected in QueryManager in order to make types available in [`@apollo/experimental-nextjs-app-support`](https://www.npmjs.com/package/@apollo/experimental-nextjs-app-support) package when extending the `ApolloClient` class. diff --git a/.changeset/dull-snakes-turn.md b/.changeset/dull-snakes-turn.md deleted file mode 100644 index 78b7dd83d2f..00000000000 --- a/.changeset/dull-snakes-turn.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@apollo/client': patch ---- - -Ensure Context value stability when rerendering ApolloProvider with the same `client` and/or `suspenseCache` prop diff --git a/.changeset/early-days-stare.md b/.changeset/early-days-stare.md deleted file mode 100644 index db8a0d6e32d..00000000000 --- a/.changeset/early-days-stare.md +++ /dev/null @@ -1,52 +0,0 @@ ---- -'@apollo/client': minor ---- - -Adds support for a `skipToken` sentinel that can be used as `options` in `useSuspenseQuery` and `useBackgroundQuery` to skip execution of a query. This works identically to the `skip` option but is more type-safe and as such, becomes the recommended way to skip query execution. As such, the `skip` option has been deprecated in favor of `skipToken`. - -We are considering the removal of the `skip` option from `useSuspenseQuery` and `useBackgroundQuery` in the next major. We are releasing with it now to make migration from `useQuery` easier and make `skipToken` more discoverable. - -```ts -import { skipToken } from '@apollo/client'; - -const id: number | undefined; - -const { data } = useSuspenseQuery( - query, - id ? { variables: { id } } : skipToken -); -``` - -### Breaking change - -Previously `useBackgroundQuery` would always return a `queryRef` whenever query execution was skipped. This behavior been updated to return a `queryRef` only when query execution is enabled. If initializing the hook with it skipped, `queryRef` is now returned as `undefined`. - -To migrate, conditionally render the component that accepts the `queryRef` as props. - -**Before** -```ts -function Parent() { - const [queryRef] = useBackgroundQuery(query, skip ? skipToken : undefined); - // ^? QueryReference - - return -} - -function Child({ queryRef }: { queryRef: QueryReference }) { - const { data } = useReadQuery(queryRef); -} -``` - -**After** -```ts -function Parent() { - const [queryRef] = useBackgroundQuery(query, skip ? skipToken : undefined); - // ^? QueryReference | undefined - - return queryRef ? : null; -} - -function Child({ queryRef }: { queryRef: QueryReference }) { - const { data } = useReadQuery(queryRef); -} -``` diff --git a/.changeset/early-pens-retire.md b/.changeset/early-pens-retire.md deleted file mode 100644 index 1eb7fe3d95b..00000000000 --- a/.changeset/early-pens-retire.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@apollo/client": patch ---- - -Avoid calling `useQuery` `onCompleted` for cache writes diff --git a/.changeset/early-pumpkins-type.md b/.changeset/early-pumpkins-type.md deleted file mode 100644 index d706a6d1f68..00000000000 --- a/.changeset/early-pumpkins-type.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@apollo/client": patch ---- - -Fixes a bug in `useMutation` so that `onError` is called when an error is returned from the request with `errorPolicy` set to 'all' . diff --git a/.changeset/famous-ladybugs-reflect.md b/.changeset/famous-ladybugs-reflect.md deleted file mode 100644 index 27c3b5f0606..00000000000 --- a/.changeset/famous-ladybugs-reflect.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@apollo/client': patch ---- - -Return `networkStatus` in the `useSuspenseQuery` result. diff --git a/.changeset/fast-tomatoes-peel.md b/.changeset/fast-tomatoes-peel.md deleted file mode 100644 index 5c8ce2a63c4..00000000000 --- a/.changeset/fast-tomatoes-peel.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@apollo/client': patch ---- - -Moves `DocumentTransform` to the `utilities` sub-package to avoid a circular dependency between the `core` and `cache` sub-packages. diff --git a/.changeset/friendly-mugs-repeat.md b/.changeset/friendly-mugs-repeat.md deleted file mode 100644 index a4050061576..00000000000 --- a/.changeset/friendly-mugs-repeat.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@apollo/client': patch ---- - -Improve `useBackgroundQuery` type interface diff --git a/.changeset/funny-peas-change.md b/.changeset/funny-peas-change.md deleted file mode 100644 index 7a9e7dc2819..00000000000 --- a/.changeset/funny-peas-change.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@apollo/client': patch ---- - -Fixes an issue where `useSuspenseQuery` would not respond to cache updates when using a cache-first `fetchPolicy` after the hook was mounted with data already in the cache. diff --git a/.changeset/grumpy-tips-know.md b/.changeset/grumpy-tips-know.md deleted file mode 100644 index 4fafac06d88..00000000000 --- a/.changeset/grumpy-tips-know.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@apollo/client": patch ---- - -More robust types for the `data` property on `UseFragmentResult`. When a partial result is given, the type is now correctly set to `Partial`. diff --git a/.changeset/heavy-ties-sneeze.md b/.changeset/heavy-ties-sneeze.md deleted file mode 100644 index cd7c4802da7..00000000000 --- a/.changeset/heavy-ties-sneeze.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@apollo/client': minor ---- - -Remove the `query`/`mutation`/`subscription` option from hooks that already take that value as their first argument. diff --git a/.changeset/honest-ads-act.md b/.changeset/honest-ads-act.md deleted file mode 100644 index 35a2d2bc27d..00000000000 --- a/.changeset/honest-ads-act.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@apollo/client': patch ---- - -Adjust the rerender timing of `useQuery` to more closely align with `useFragment`. This means that cache updates delivered to both hooks should trigger renders at relatively the same time. Previously, the `useFragment` might rerender much faster leading to some confusion. diff --git a/.changeset/hungry-chairs-live.md b/.changeset/hungry-chairs-live.md deleted file mode 100644 index 08f5a95a862..00000000000 --- a/.changeset/hungry-chairs-live.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -'@apollo/client': minor ---- - -Add a new mechanism for Error Extraction to reduce bundle size by including -error message texts on an opt-in basis. -By default, errors will link to an error page with the entire error message. -This replaces "development" and "production" errors and works without -additional bundler configuration. -Bundling the text of error messages and development warnings can be enabled by -```js -import { loadErrorMessages, loadDevMessages } from "@apollo/client/dev"; -if (process.env.NODE_ENV !== "production") { - loadErrorMessages(); - loadDevMessages(); -} -``` diff --git a/.changeset/hungry-eagles-kick.md b/.changeset/hungry-eagles-kick.md deleted file mode 100644 index b83f7969726..00000000000 --- a/.changeset/hungry-eagles-kick.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@apollo/client': minor ---- - -prevent accidental widening of inferred TData and TVariables generics for query hook option arguments diff --git a/.changeset/itchy-bulldogs-help.md b/.changeset/itchy-bulldogs-help.md deleted file mode 100644 index beb5bf7ec55..00000000000 --- a/.changeset/itchy-bulldogs-help.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@apollo/client': patch ---- - -Store React.Context instance mapped by React.createContext instance, not React.version. -Using `React.version` can cause problems with `preact`, as multiple versions of `preact` will all identify themselves as React `17.0.2`. diff --git a/.changeset/large-beers-rhyme.md b/.changeset/large-beers-rhyme.md deleted file mode 100644 index 392e4d1a199..00000000000 --- a/.changeset/large-beers-rhyme.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@apollo/client': patch ---- - -Use `import * as React` everywhere. This prevents an error when importing `@apollo/client` in a React Server component. (see [#10974](https://github.com/apollographql/apollo-client/issues/10974)) diff --git a/.changeset/lazy-teachers-sell.md b/.changeset/lazy-teachers-sell.md deleted file mode 100644 index bac8fb053d8..00000000000 --- a/.changeset/lazy-teachers-sell.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@apollo/client': minor ---- - -Simplify `__DEV__` polyfill to use imports instead of global scope diff --git a/.changeset/lemon-fans-shake.md b/.changeset/lemon-fans-shake.md deleted file mode 100644 index b04acc33dbb..00000000000 --- a/.changeset/lemon-fans-shake.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@apollo/client': minor ---- - -Add .js file extensions to imports in src and dist/**/*.d.ts diff --git a/.changeset/light-ravens-wait.md b/.changeset/light-ravens-wait.md deleted file mode 100644 index 8b27704b073..00000000000 --- a/.changeset/light-ravens-wait.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@apollo/client': patch ---- - -Chore: Add ESLint rule for consistent type imports, apply autofix diff --git a/.changeset/little-schools-roll.md b/.changeset/little-schools-roll.md deleted file mode 100644 index 71cd7ddd874..00000000000 --- a/.changeset/little-schools-roll.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@apollo/client': patch ---- - -Fix a bug in `QueryReference` where `this.resolve` or `this.reject` might be executed even if `undefined`. diff --git a/.changeset/mean-tigers-thank.md b/.changeset/mean-tigers-thank.md deleted file mode 100644 index c20e7754c38..00000000000 --- a/.changeset/mean-tigers-thank.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@apollo/client': patch ---- - -Add support for the `skip` option in `useBackgroundQuery` and `useSuspenseQuery`. Setting this option to `true` will avoid a network request. diff --git a/.changeset/modern-peaches-marry.md b/.changeset/modern-peaches-marry.md deleted file mode 100644 index 19c831a28e7..00000000000 --- a/.changeset/modern-peaches-marry.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@apollo/client': minor ---- - -Implement a `@nonreactive` directive for selectively skipping reactive comparisons of query result subtrees diff --git a/.changeset/neat-rockets-sleep.md b/.changeset/neat-rockets-sleep.md deleted file mode 100644 index 0ba581b2d3f..00000000000 --- a/.changeset/neat-rockets-sleep.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -'@apollo/client': patch ---- - -Fix the compatibility between `useSuspenseQuery` and React's `useDeferredValue` and `startTransition` APIs to allow React to show stale UI while the changes to the variable cause the component to suspend. - -# Breaking change - -`nextFetchPolicy` support has been removed from `useSuspenseQuery`. If you are using this option, remove it, otherwise it will be ignored. diff --git a/.changeset/nice-eyes-return.md b/.changeset/nice-eyes-return.md deleted file mode 100644 index 799f4f0bc52..00000000000 --- a/.changeset/nice-eyes-return.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@apollo/client': minor ---- - -When changing variables back to a previously used set of variables, do not automatically cache the result as part of the query reference. Instead, dispose of the query reference so that the `InMemoryCache` can determine the cached behavior. This means that fetch policies that would guarantee a network request are now honored when switching back to previously used variables. diff --git a/.changeset/nine-boxes-happen.md b/.changeset/nine-boxes-happen.md deleted file mode 100644 index b7e006ad03b..00000000000 --- a/.changeset/nine-boxes-happen.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@apollo/client': patch ---- - -Remove experimental labels from hooks, move to beta. diff --git a/.changeset/odd-pumpkins-care.md b/.changeset/odd-pumpkins-care.md deleted file mode 100644 index d2ecc5b0e2e..00000000000 --- a/.changeset/odd-pumpkins-care.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@apollo/client': patch ---- - -Fixes a bug in `BatchHttpLink` that removed variables from all requests by default. diff --git a/.changeset/odd-students-crash.md b/.changeset/odd-students-crash.md deleted file mode 100644 index ede83e9c182..00000000000 --- a/.changeset/odd-students-crash.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@apollo/client': patch ---- - -Fix type policy inheritance involving fuzzy `possibleTypes` diff --git a/.changeset/old-moles-run.md b/.changeset/old-moles-run.md deleted file mode 100644 index de50ef7fc96..00000000000 --- a/.changeset/old-moles-run.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@apollo/client": patch ---- - -Fix `includeUnusedVariables` option not working with `BatchHttpLink` diff --git a/.changeset/olive-pans-report.md b/.changeset/olive-pans-report.md deleted file mode 100644 index 489155ee529..00000000000 --- a/.changeset/olive-pans-report.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@apollo/client': patch ---- - -`useBackgroundQuery` now uses its own options type called `BackgroundQueryHookOptions` rather than reusing `SuspenseQueryHookOptions`. diff --git a/.changeset/orange-suns-check.md b/.changeset/orange-suns-check.md deleted file mode 100644 index 8731d5a755d..00000000000 --- a/.changeset/orange-suns-check.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@apollo/client': patch ---- - -Incrementally re-render deferred queries after calling `refetch` or setting `skip` to `false` to match the behavior of the initial fetch. Previously, the hook would not re-render until the entire result had finished loading in these cases. diff --git a/.changeset/polite-birds-rescue.md b/.changeset/polite-birds-rescue.md deleted file mode 100644 index c248b44089b..00000000000 --- a/.changeset/polite-birds-rescue.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@apollo/client': patch ---- - -Silence useLayoutEffect warning when useSuspenseQuery runs on server diff --git a/.changeset/polite-pianos-kiss.md b/.changeset/polite-pianos-kiss.md deleted file mode 100644 index d88a7fe35fe..00000000000 --- a/.changeset/polite-pianos-kiss.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@apollo/client': minor ---- - -(Batch)HttpLink: Propagate `AbortError`s to the user when a user-provided `signal` is passed to the link. Previously, these links would swallow all `AbortErrors`, potentially causing queries and mutations to never resolve. As a result of this change, users are now expected to handle `AbortError`s when passing in a user-provided `signal`. \ No newline at end of file diff --git a/.changeset/popular-beers-move.md b/.changeset/popular-beers-move.md deleted file mode 100644 index 6ee6221f03a..00000000000 --- a/.changeset/popular-beers-move.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@apollo/client': patch ---- - -Fix an issue when using a link that relied on `operation.getContext` and `operation.setContext` would error out when it was declared after the `removeTypenameFromVariables` link. diff --git a/.changeset/rude-frogs-destroy.md b/.changeset/rude-frogs-destroy.md deleted file mode 100644 index ec5b7dca2a4..00000000000 --- a/.changeset/rude-frogs-destroy.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@apollo/client': patch ---- - -Use printed query for query deduplication. Cache `print` calls for GraphQL documents to speed up repeated operations. diff --git a/.changeset/rude-mayflies-scream.md b/.changeset/rude-mayflies-scream.md deleted file mode 100644 index d3896e963a9..00000000000 --- a/.changeset/rude-mayflies-scream.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@apollo/client': minor ---- - -Add the ability to allow `@client` fields to be sent to the link chain. diff --git a/.changeset/seven-needles-remember.md b/.changeset/seven-needles-remember.md deleted file mode 100644 index 7b738e2c5f1..00000000000 --- a/.changeset/seven-needles-remember.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@apollo/client': patch ---- - -[#10509](https://github.com/apollographql/apollo-client/pull/10509) introduced some helpers for determining the type of operation for a GraphQL query. This imported the `OperationTypeNode` from graphql-js which is not available in GraphQL 14. To maintain compatibility with graphql-js v14, this has been reverted to use plain strings. diff --git a/.changeset/seven-onions-burn.md b/.changeset/seven-onions-burn.md deleted file mode 100644 index b319ddd8232..00000000000 --- a/.changeset/seven-onions-burn.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@apollo/client': minor ---- - -Feature: adds `useBackgroundQuery` and `useReadQuery` hooks diff --git a/.changeset/sharp-trees-cough.md b/.changeset/sharp-trees-cough.md deleted file mode 100644 index 0a7b11a902d..00000000000 --- a/.changeset/sharp-trees-cough.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@apollo/client': patch ---- - -More robust typings for the `data` property returned from `useSuspenseQuery` when using `returnPartialData: true` or an `errorPolicy` of `all` or `ignore`. `TData` now defaults to `unknown` instead of `any`. diff --git a/.changeset/short-bikes-mate.md b/.changeset/short-bikes-mate.md deleted file mode 100644 index fab5b4f20cb..00000000000 --- a/.changeset/short-bikes-mate.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@apollo/client': patch ---- - -Always throw network errors in `useSuspenseQuery` regardless of the set `errorPolicy`. diff --git a/.changeset/short-feet-relax.md b/.changeset/short-feet-relax.md deleted file mode 100644 index de4174863c8..00000000000 --- a/.changeset/short-feet-relax.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@apollo/client': patch ---- - -Change an import in `useQuery` and `useMutation` that added an unnecessary runtime dependency on `@apollo/client/core`. This drastically reduces the bundle size of each the hooks. diff --git a/.changeset/short-monkeys-love.md b/.changeset/short-monkeys-love.md deleted file mode 100644 index ed0688a8669..00000000000 --- a/.changeset/short-monkeys-love.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@apollo/client': patch ---- - -Remove the deprecated `returnPartialData` option from `useFragment` hook. diff --git a/.changeset/silent-eagles-check.md b/.changeset/silent-eagles-check.md deleted file mode 100644 index a9875aa1e70..00000000000 --- a/.changeset/silent-eagles-check.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'@apollo/client': minor ---- - -Introduce the new `removeTypenameFromVariables` link. This link will automatically remove `__typename` fields from `variables` for all operations. This link can be configured to exclude JSON-scalars for scalars that utilize `__typename`. - -This change undoes some work from #10724 where `__typename` was automatically stripped for all operations with no configuration. This was determined to be a breaking change and therefore moved into this link. diff --git a/.changeset/silver-radios-chew.md b/.changeset/silver-radios-chew.md deleted file mode 100644 index 4b869d0329b..00000000000 --- a/.changeset/silver-radios-chew.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@apollo/client': patch ---- - -Ensure `refetch`, `fetchMore`, and `subscribeToMore` functions returned by `useSuspenseQuery` are referentially stable between renders, even as `data` is updated. diff --git a/.changeset/sixty-trains-sniff.md b/.changeset/sixty-trains-sniff.md deleted file mode 100644 index b14d5aca6c9..00000000000 --- a/.changeset/sixty-trains-sniff.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@apollo/client': patch ---- - -Add `@defer` support to `useSuspenseQuery`. diff --git a/.changeset/small-pots-applaud.md b/.changeset/small-pots-applaud.md deleted file mode 100644 index a0017bfa2e5..00000000000 --- a/.changeset/small-pots-applaud.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -'@apollo/client': patch ---- - -Updates dependency versions in `package.json` by bumping: - -- `@wry/context` to `^0.7.3` -- `@wry/equality` to `^0.5.6` -- `@wry/trie` to `^0.4.3` -- `optimism` to `^0.17.4` - -to 1. [fix sourcemap warnings](https://github.com/benjamn/wryware/pull/497) and 2. a Codesandbox [sandpack (in-browser) bundler transpilation bug](https://github.com/codesandbox/sandpack/issues/940) with an [upstream optimism workaround](https://github.com/benjamn/optimism/pull/550). diff --git a/.changeset/small-timers-shake.md b/.changeset/small-timers-shake.md deleted file mode 100644 index f37c10ca874..00000000000 --- a/.changeset/small-timers-shake.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@apollo/client': minor ---- - -Add support for React suspense with a new `useSuspenseQuery` hook. diff --git a/.changeset/small-tomatoes-explode.md b/.changeset/small-tomatoes-explode.md deleted file mode 100644 index 2f5c39228c3..00000000000 --- a/.changeset/small-tomatoes-explode.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@apollo/client': minor ---- - -Allow `ApolloCache` implementations to specify default value for `assumeImmutableResults` client option, improving performance for applications currently using `InMemoryCache` without configuring `new ApolloClient({ assumeImmutableResults: true })` diff --git a/.changeset/smooth-clouds-sort.md b/.changeset/smooth-clouds-sort.md deleted file mode 100644 index 292eb6b0122..00000000000 --- a/.changeset/smooth-clouds-sort.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@apollo/client': patch ---- - -Hide queryRef in a Symbol in `useBackgroundQuery`s return value. diff --git a/.changeset/smooth-forks-shop.md b/.changeset/smooth-forks-shop.md deleted file mode 100644 index 60cb3632ea0..00000000000 --- a/.changeset/smooth-forks-shop.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@apollo/client': patch ---- - -use `React.use` where available diff --git a/.changeset/smooth-goats-cheat.md b/.changeset/smooth-goats-cheat.md deleted file mode 100644 index f1b7beb1c80..00000000000 --- a/.changeset/smooth-goats-cheat.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -'@apollo/client': minor ---- - -`HttpLink`/`BatchHttpLink`: Abort the `AbortController` signal more granularly. -Before this change, when `HttpLink`/`BatchHttpLink` created an `AbortController` -internally, the signal would always be `.abort`ed after the request was completed. This could cause issues with Sentry Session Replay and Next.js App Router Cache invalidations, which just replayed the fetch with the same options - including the cancelled `AbortSignal`. - -With this change, the `AbortController` will only be `.abort()`ed by outside events, -not as a consequence of the request completing. diff --git a/.changeset/sour-weeks-suffer.md b/.changeset/sour-weeks-suffer.md deleted file mode 100644 index d193f144b63..00000000000 --- a/.changeset/sour-weeks-suffer.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -'@apollo/client': patch ---- - -Throw errors in `useSuspenseQuery` for errors returned in incremental chunks when `errorPolicy` is `none`. This provides a more consistent behavior of the `errorPolicy` in the hook. - -### Potentially breaking change - -Previously, if you issued a query with `@defer` and relied on `errorPolicy: 'none'` to set the `error` property returned from `useSuspenseQuery` when the error was returned in an incremental chunk, this error is now thrown. Switch the `errorPolicy` to `all` to avoid throwing the error and instead return it in the `error` property. diff --git a/.changeset/spotty-news-stare.md b/.changeset/spotty-news-stare.md deleted file mode 100644 index 7dd57152d5c..00000000000 --- a/.changeset/spotty-news-stare.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@apollo/client': patch ---- - -Adds support for `returnPartialData` and `refetchWritePolicy` options in `useBackgroundQuery` hook. diff --git a/.changeset/strange-drinks-report.md b/.changeset/strange-drinks-report.md deleted file mode 100644 index 60f7c265d8d..00000000000 --- a/.changeset/strange-drinks-report.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@apollo/client': patch ---- - -Fixed the ability to use `refetch` and `fetchMore` with React's `startTransition`. The hook will now behave correctly by allowing React to avoid showing the Suspense fallback when these functions are wrapped by `startTransition`. This change deprecates the `suspensePolicy` option in favor of `startTransition`. diff --git a/.changeset/tame-owls-lick.md b/.changeset/tame-owls-lick.md deleted file mode 100644 index 5ee8c661520..00000000000 --- a/.changeset/tame-owls-lick.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@apollo/client': patch ---- - -Restore Apollo Client 3.7 `getApolloContext` behaviour diff --git a/.changeset/tasty-wasps-relate.md b/.changeset/tasty-wasps-relate.md deleted file mode 100644 index 2afc655ca41..00000000000 --- a/.changeset/tasty-wasps-relate.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@apollo/client': patch ---- - -Slightly decrease bundle size and memory footprint of `SuspenseCache` by changing how cache entries are stored internally. diff --git a/.changeset/ten-cherries-clap.md b/.changeset/ten-cherries-clap.md deleted file mode 100644 index f4d570511f3..00000000000 --- a/.changeset/ten-cherries-clap.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@apollo/client': patch ---- - -`useSuspenseQuery` and `useBackgroundQuery` will now properly apply changes to its options between renders. diff --git a/.changeset/three-grapes-marry.md b/.changeset/three-grapes-marry.md deleted file mode 100644 index 886a74dc444..00000000000 --- a/.changeset/three-grapes-marry.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@apollo/client': minor ---- - -Changes how development-only code is bundled in the library to more reliably enable consuming bundlers to reduce production bundle sizes while keeping compatibility with non-node environments. diff --git a/.changeset/twelve-files-promise.md b/.changeset/twelve-files-promise.md deleted file mode 100644 index 6c82e2d9e7f..00000000000 --- a/.changeset/twelve-files-promise.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@apollo/client': patch ---- - -The "per-React-Version-Singleton" ApolloContext is now stored on `globalThis`, not `React.createContext`, and throws an error message when accessed from React Server Components. diff --git a/.changeset/warm-pandas-cry.md b/.changeset/warm-pandas-cry.md deleted file mode 100644 index 3003de4221b..00000000000 --- a/.changeset/warm-pandas-cry.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -'@apollo/client': minor ---- - -Add the ability to specify custom GraphQL document transforms. These transforms are run before reading data from the cache, before local state is resolved, and before the query document is sent through the link chain. - -To register a custom document transform, create a transform using the `DocumentTransform` class and pass it to the `documentTransform` option on `ApolloClient`. - -```ts -import { DocumentTransform } from '@apollo/client'; - -const documentTransform = new DocumentTransform((document) => { - // do something with `document` - return transformedDocument; -}); - -const client = new ApolloClient({ documentTransform: documentTransform }); -``` - -For additional documentation on the behavior and API of `DocumentTransform`, see the [pull request](https://github.com/apollographql/apollo-client/pull/10509). diff --git a/.changeset/wild-mice-nail.md b/.changeset/wild-mice-nail.md deleted file mode 100644 index f6f84822a85..00000000000 --- a/.changeset/wild-mice-nail.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@apollo/client': patch ---- - -Add support for the `subscribeToMore` and `client` fields returned in the `useSuspenseQuery` result. diff --git a/CHANGELOG.md b/CHANGELOG.md index 98702af9be7..ab457f007ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,296 @@ # @apollo/client +## 3.8.0 + +### Minor Changes + +- [#10895](https://github.com/apollographql/apollo-client/pull/10895) [`e187866fd`](https://github.com/apollographql/apollo-client/commit/e187866fdfbbd1e1e30646f289367fb4b5afb3c3) Thanks [@(author)]()! - Add generic type parameter for the entity modified in `cache.modify`. Improves + TypeScript type inference for that type's fields and values of those fields. + + Example: + + ```ts + cache.modify({ + id: cache.identify(someBook), + fields: { + title: (title) => { + // title has type `string`. + // It used to be `any`. + }, + => { + // author has type `Reference | Book["author"]`. + // It used to be `any`. + }, + }, + }); + ``` + +- [#10895](https://github.com/apollographql/apollo-client/pull/10895) [`e187866fd`](https://github.com/apollographql/apollo-client/commit/e187866fdfbbd1e1e30646f289367fb4b5afb3c3) Thanks [@Gelio](https://github.com/Gelio)! - Use unique opaque types for the `DELETE` and `INVALIDATE` Apollo cache modifiers. + + This increases type safety, since these 2 modifiers no longer have the `any` type. + Moreover, it no longer triggers [the `@typescript-eslint/no-unsafe-return` + rule](https://typescript-eslint.io/rules/no-unsafe-return/). + +- [#11112](https://github.com/apollographql/apollo-client/pull/11112) [`b4aefcfe9`](https://github.com/apollographql/apollo-client/commit/b4aefcfe97213461b9ce01946344e6a5e6d80704) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Adds support for a `skipToken` sentinel that can be used as `options` in `useSuspenseQuery` and `useBackgroundQuery` to skip execution of a query. This works identically to the `skip` option but is more type-safe and as such, becomes the recommended way to skip query execution. As such, the `skip` option has been deprecated in favor of `skipToken`. + + We are considering the removal of the `skip` option from `useSuspenseQuery` and `useBackgroundQuery` in the next major. We are releasing with it now to make migration from `useQuery` easier and make `skipToken` more discoverable. + + ```ts + import { skipToken } from "@apollo/client"; + + const id: number | undefined; + + const { data } = useSuspenseQuery( + query, + id ? { variables: { id } } : skipToken + ); + ``` + + ### Breaking change + + Previously `useBackgroundQuery` would always return a `queryRef` whenever query execution was skipped. This behavior been updated to return a `queryRef` only when query execution is enabled. If initializing the hook with it skipped, `queryRef` is now returned as `undefined`. + + To migrate, conditionally render the component that accepts the `queryRef` as props. + + **Before** + + ```ts + function Parent() { + const [queryRef] = useBackgroundQuery(query, skip ? skipToken : undefined); + // ^? QueryReference + + return ; + } + + function Child({ + queryRef, + }: { + queryRef: QueryReference; + }) { + const { data } = useReadQuery(queryRef); + } + ``` + + **After** + + ```ts + function Parent() { + const [queryRef] = useBackgroundQuery(query, skip ? skipToken : undefined); + // ^? QueryReference | undefined + + return queryRef ? : null; + } + + function Child({ queryRef }: { queryRef: QueryReference }) { + const { data } = useReadQuery(queryRef); + } + ``` + +- [#10527](https://github.com/apollographql/apollo-client/pull/10527) [`0cc7e2e19`](https://github.com/apollographql/apollo-client/commit/0cc7e2e194f84e137a502395f26acdaef392ecae) Thanks [@phryneas](https://github.com/phryneas)! - Remove the `query`/`mutation`/`subscription` option from hooks that already take that value as their first argument. + +- [#10887](https://github.com/apollographql/apollo-client/pull/10887) [`f8c0b965d`](https://github.com/apollographql/apollo-client/commit/f8c0b965d49fb7d802371bb9cc3cb0b60cf05e5d) Thanks [@phryneas](https://github.com/phryneas)! - Add a new mechanism for Error Extraction to reduce bundle size by including + error message texts on an opt-in basis. + By default, errors will link to an error page with the entire error message. + This replaces "development" and "production" errors and works without + additional bundler configuration. + Bundling the text of error messages and development warnings can be enabled by + + ```js + import { loadErrorMessages, loadDevMessages } from "@apollo/client/dev"; + if (process.env.NODE_ENV !== "production") { + loadErrorMessages(); + loadDevMessages(); + } + ``` + +- [#10506](https://github.com/apollographql/apollo-client/pull/10506) [`2dc2e1d4f`](https://github.com/apollographql/apollo-client/commit/2dc2e1d4f77318d8a4c29445344b4f8c5b08b7e3) Thanks [@phryneas](https://github.com/phryneas)! - prevent accidental widening of inferred TData and TVariables generics for query hook option arguments + +- [#10521](https://github.com/apollographql/apollo-client/pull/10521) [`fbf729414`](https://github.com/apollographql/apollo-client/commit/fbf729414b6322a84158d9864bdfb5b17b2c7d77) Thanks [@benjamn](https://github.com/benjamn)! - Simplify `__DEV__` polyfill to use imports instead of global scope + +- [#10994](https://github.com/apollographql/apollo-client/pull/10994) [`2ebbd3abb`](https://github.com/apollographql/apollo-client/commit/2ebbd3abb31224ed383896ebea7c2791c9b42a22) Thanks [@phryneas](https://github.com/phryneas)! - Add .js file extensions to imports in src and dist/\*_/_.d.ts + +- [#10722](https://github.com/apollographql/apollo-client/pull/10722) [`c7e60f83d`](https://github.com/apollographql/apollo-client/commit/c7e60f83dd1dfe07a1b6ce60d9675d3616a2ce66) Thanks [@benjamn](https://github.com/benjamn)! - Implement a `@nonreactive` directive for selectively skipping reactive comparisons of query result subtrees + +- [#11045](https://github.com/apollographql/apollo-client/pull/11045) [`9c1d4a104`](https://github.com/apollographql/apollo-client/commit/9c1d4a104d721993b5b306ca4c21724a974e098d) Thanks [@jerelmiller](https://github.com/jerelmiller)! - When changing variables back to a previously used set of variables, do not automatically cache the result as part of the query reference. Instead, dispose of the query reference so that the `InMemoryCache` can determine the cached behavior. This means that fetch policies that would guarantee a network request are now honored when switching back to previously used variables. + +- [#11058](https://github.com/apollographql/apollo-client/pull/11058) [`89bf33c42`](https://github.com/apollographql/apollo-client/commit/89bf33c425d08880eeaed4584bdd56c4caf085e7) Thanks [@phryneas](https://github.com/phryneas)! - (Batch)HttpLink: Propagate `AbortError`s to the user when a user-provided `signal` is passed to the link. Previously, these links would swallow all `AbortErrors`, potentially causing queries and mutations to never resolve. As a result of this change, users are now expected to handle `AbortError`s when passing in a user-provided `signal`. + +- [#10346](https://github.com/apollographql/apollo-client/pull/10346) [`3bcfc42d3`](https://github.com/apollographql/apollo-client/commit/3bcfc42d394b6a97900495eacdaf58c31ae96d9f) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Add the ability to allow `@client` fields to be sent to the link chain. + +- [#10755](https://github.com/apollographql/apollo-client/pull/10755) [`e3c676deb`](https://github.com/apollographql/apollo-client/commit/e3c676deb59d006f33d24a7211e58725a67641b8) Thanks [@alessbell](https://github.com/alessbell)! - Feature: adds `useBackgroundQuery` and `useReadQuery` hooks + +- [#10853](https://github.com/apollographql/apollo-client/pull/10853) [`300957960`](https://github.com/apollographql/apollo-client/commit/300957960a584920f2d346d29a0b3aaeb27d9489) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Introduce the new `removeTypenameFromVariables` link. This link will automatically remove `__typename` fields from `variables` for all operations. This link can be configured to exclude JSON-scalars for scalars that utilize `__typename`. + + This change undoes some work from #10724 where `__typename` was automatically stripped for all operations with no configuration. This was determined to be a breaking change and therefore moved into this link. + +- [#10323](https://github.com/apollographql/apollo-client/pull/10323) [`64cb88a4b`](https://github.com/apollographql/apollo-client/commit/64cb88a4b6be8640c4e0d753dd06ddf4c25a2bc3) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Add support for React suspense with a new `useSuspenseQuery` hook. + +- [#10567](https://github.com/apollographql/apollo-client/pull/10567) [`c2ce6496c`](https://github.com/apollographql/apollo-client/commit/c2ce6496c10e7ae7e29d25161c2d3cef3e2c6144) Thanks [@benjamn](https://github.com/benjamn)! - Allow `ApolloCache` implementations to specify default value for `assumeImmutableResults` client option, improving performance for applications currently using `InMemoryCache` without configuring `new ApolloClient({ assumeImmutableResults: true })` + +- [#11040](https://github.com/apollographql/apollo-client/pull/11040) [`125ef5b2a`](https://github.com/apollographql/apollo-client/commit/125ef5b2a8fd2de1515b2bdd71785ebab3596cb2) Thanks [@phryneas](https://github.com/phryneas)! - `HttpLink`/`BatchHttpLink`: Abort the `AbortController` signal more granularly. + Before this change, when `HttpLink`/`BatchHttpLink` created an `AbortController` + internally, the signal would always be `.abort`ed after the request was completed. This could cause issues with Sentry Session Replay and Next.js App Router Cache invalidations, which just replayed the fetch with the same options - including the cancelled `AbortSignal`. + + With this change, the `AbortController` will only be `.abort()`ed by outside events, + not as a consequence of the request completing. + +- [#10915](https://github.com/apollographql/apollo-client/pull/10915) [`3a62d8228`](https://github.com/apollographql/apollo-client/commit/3a62d8228ab6c15cdb7cd4ea106d13ba3e6f0029) Thanks [@phryneas](https://github.com/phryneas)! - Changes how development-only code is bundled in the library to more reliably enable consuming bundlers to reduce production bundle sizes while keeping compatibility with non-node environments. + +- [#10509](https://github.com/apollographql/apollo-client/pull/10509) [`79df2c7ba`](https://github.com/apollographql/apollo-client/commit/79df2c7ba55b7cfee69fd54024174f77099a2550) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Add the ability to specify custom GraphQL document transforms. These transforms are run before reading data from the cache, before local state is resolved, and before the query document is sent through the link chain. + + To register a custom document transform, create a transform using the `DocumentTransform` class and pass it to the `documentTransform` option on `ApolloClient`. + + ```ts + import { DocumentTransform } from "@apollo/client"; + + const documentTransform = new DocumentTransform((document) => { + // do something with `document` + return transformedDocument; + }); + + const client = new ApolloClient({ documentTransform: documentTransform }); + ``` + + For additional documentation on the behavior and API of `DocumentTransform`, see the [pull request](https://github.com/apollographql/apollo-client/pull/10509). + +### Patch Changes + +- [#11086](https://github.com/apollographql/apollo-client/pull/11086) [`0264fee06`](https://github.com/apollographql/apollo-client/commit/0264fee066cb715602eda26c7c0bb1254469eccb) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Fix an issue where a call to `refetch`, `fetchMore`, or changing `skip` to `false` that returned a result deeply equal to data in the cache would get stuck in a pending state and never resolve. + +- [#11053](https://github.com/apollographql/apollo-client/pull/11053) [`c0ca70720`](https://github.com/apollographql/apollo-client/commit/c0ca70720cf5fbedd6e4f128b460c1995d9c55a7) Thanks [@phryneas](https://github.com/phryneas)! - Add `SuspenseCache` as a lazy hidden property on ApolloClient. + This means that `SuspenseCache` is now an implementation details of Apollo Client + and you no longer need to manually instantiate it and no longer need to pass it + into `ApolloProvider`. + Trying to instantiate a `SuspenseCache` instance in your code will now throw an + error. + + Migration: + + ```diff + -import { SuspenseCache } from '@apollo/client'; + + -const suspenseCache = new SuspenseCache(); + + -; + +; + ``` + +- [#11115](https://github.com/apollographql/apollo-client/pull/11115) [`78739e3ef`](https://github.com/apollographql/apollo-client/commit/78739e3efe86f6db959dd792d21fa12e0427b12c) Thanks [@phryneas](https://github.com/phryneas)! - Enforce `export type` for all type-level exports. + +- [#11027](https://github.com/apollographql/apollo-client/pull/11027) [`e47cfd04e`](https://github.com/apollographql/apollo-client/commit/e47cfd04ec50cb4c19828f4d655eb0f989cdcf7d) Thanks [@phryneas](https://github.com/phryneas)! - Prevents the DevTool installation warning to be turned into a documentation link. + +- [#10594](https://github.com/apollographql/apollo-client/pull/10594) [`f221b5e8f`](https://github.com/apollographql/apollo-client/commit/f221b5e8fafef3970af2037218c2396ae7db505e) Thanks [@phryneas](https://github.com/phryneas)! - Add a `suspenseCache` option to `useSuspenseQuery` + +- [#10700](https://github.com/apollographql/apollo-client/pull/10700) [`12e37f46f`](https://github.com/apollographql/apollo-client/commit/12e37f46f17f0d5a6d408b89ebafbf7413f309ab) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Add a `queryKey` option to `useSuspenseQuery` that allows the hook to create a unique subscription instance. + +- [#10724](https://github.com/apollographql/apollo-client/pull/10724) [`e285dfd00`](https://github.com/apollographql/apollo-client/commit/e285dfd003c7074383732ee23e539d7a0316af10) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Automatically strips `__typename` fields from `variables` sent to the server when using [`HttpLink`](https://www.apollographql.com/docs/react/api/link/apollo-link-http), [`BatchHttpLink`](https://www.apollographql.com/docs/react/api/link/apollo-link-batch-http), or [`GraphQLWsLink`](https://www.apollographql.com/docs/react/api/link/apollo-link-subscriptions). This allows GraphQL data returned from a query to be used as an argument to a subsequent GraphQL operation without the need to strip the `__typename` in user-space. + +- [#10957](https://github.com/apollographql/apollo-client/pull/10957) [`445164d21`](https://github.com/apollographql/apollo-client/commit/445164d2177efe46637a514afa6a88502d3de10f) Thanks [@phryneas](https://github.com/phryneas)! - Use `React.version` as key for shared Contexts. + +- [#10635](https://github.com/apollographql/apollo-client/pull/10635) [`7df51ee19`](https://github.com/apollographql/apollo-client/commit/7df51ee19a49a92f48c0f58f91894d32091cb294) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Fix an issue where cache updates would not propagate to `useSuspenseQuery` while in strict mode. + +- [#11013](https://github.com/apollographql/apollo-client/pull/11013) [`5ed2cfdaf`](https://github.com/apollographql/apollo-client/commit/5ed2cfdaf9030550d4c82200a5a690b112ad3335) Thanks [@alessbell](https://github.com/alessbell)! - Make private fields `inFlightLinkObservables` and `fetchCancelFns` protected in QueryManager in order to make types available in [`@apollo/experimental-nextjs-app-support`](https://www.npmjs.com/package/@apollo/experimental-nextjs-app-support) package when extending the `ApolloClient` class. + +- [#10869](https://github.com/apollographql/apollo-client/pull/10869) [`ba1d06166`](https://github.com/apollographql/apollo-client/commit/ba1d0616618ee040e9bcb20874b03d5783f7eff3) Thanks [@phryneas](https://github.com/phryneas)! - Ensure Context value stability when rerendering ApolloProvider with the same `client` and/or `suspenseCache` prop + +- [#10340](https://github.com/apollographql/apollo-client/pull/10340) [`4f73c5ca1`](https://github.com/apollographql/apollo-client/commit/4f73c5ca15d367aa23f02018d062f221c4506a4d) Thanks [@alessbell](https://github.com/alessbell)! - Avoid calling `useQuery` `onCompleted` for cache writes + +- [#11103](https://github.com/apollographql/apollo-client/pull/11103) [`e3d611daf`](https://github.com/apollographql/apollo-client/commit/e3d611daf7a014e5c92d6bed75d67b9187437eda) Thanks [@caylahamann](https://github.com/caylahamann)! - Fixes a bug in `useMutation` so that `onError` is called when an error is returned from the request with `errorPolicy` set to 'all' . + +- [#10657](https://github.com/apollographql/apollo-client/pull/10657) [`db305a800`](https://github.com/apollographql/apollo-client/commit/db305a8005664e9b6ec64046da230f41d293104d) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Return `networkStatus` in the `useSuspenseQuery` result. + +- [#10937](https://github.com/apollographql/apollo-client/pull/10937) [`eea44eb87`](https://github.com/apollographql/apollo-client/commit/eea44eb87f6f296a6f9978d6ba1cf36e899c9131) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Moves `DocumentTransform` to the `utilities` sub-package to avoid a circular dependency between the `core` and `cache` sub-packages. + +- [#10951](https://github.com/apollographql/apollo-client/pull/10951) [`2e833b2ca`](https://github.com/apollographql/apollo-client/commit/2e833b2cacb71fc2050cb3976d0bbe710baeedff) Thanks [@alessbell](https://github.com/alessbell)! - Improve `useBackgroundQuery` type interface + +- [#10651](https://github.com/apollographql/apollo-client/pull/10651) [`8355d0e1e`](https://github.com/apollographql/apollo-client/commit/8355d0e1e9c1cee58cabd7df68d3ba09a3afaf6c) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Fixes an issue where `useSuspenseQuery` would not respond to cache updates when using a cache-first `fetchPolicy` after the hook was mounted with data already in the cache. + +- [#10765](https://github.com/apollographql/apollo-client/pull/10765) [`35f36c5aa`](https://github.com/apollographql/apollo-client/commit/35f36c5aaefe1f215044e09fdf9386042bc59dd2) Thanks [@phryneas](https://github.com/phryneas)! - More robust types for the `data` property on `UseFragmentResult`. When a partial result is given, the type is now correctly set to `Partial`. + +- [#11083](https://github.com/apollographql/apollo-client/pull/11083) [`f766e8305`](https://github.com/apollographql/apollo-client/commit/f766e8305d9f2dbde59a61b8e70c99c4b2b67d55) Thanks [@phryneas](https://github.com/phryneas)! - Adjust the rerender timing of `useQuery` to more closely align with `useFragment`. This means that cache updates delivered to both hooks should trigger renders at relatively the same time. Previously, the `useFragment` might rerender much faster leading to some confusion. + +- [#11026](https://github.com/apollographql/apollo-client/pull/11026) [`b8d405eee`](https://github.com/apollographql/apollo-client/commit/b8d405eee2a81df92861be5abd9bd874d7cad111) Thanks [@phryneas](https://github.com/phryneas)! - Store React.Context instance mapped by React.createContext instance, not React.version. + Using `React.version` can cause problems with `preact`, as multiple versions of `preact` will all identify themselves as React `17.0.2`. + +- [#11000](https://github.com/apollographql/apollo-client/pull/11000) [`1d43ab616`](https://github.com/apollographql/apollo-client/commit/1d43ab6169b2b2ebfd8f86366212667f9609f5f5) Thanks [@phryneas](https://github.com/phryneas)! - Use `import * as React` everywhere. This prevents an error when importing `@apollo/client` in a React Server component. (see [#10974](https://github.com/apollographql/apollo-client/issues/10974)) + +- [#10852](https://github.com/apollographql/apollo-client/pull/10852) [`27fbdb3f9`](https://github.com/apollographql/apollo-client/commit/27fbdb3f9003cc304d26987cb38daf10910f2da6) Thanks [@phryneas](https://github.com/phryneas)! - Chore: Add ESLint rule for consistent type imports, apply autofix + +- [#10999](https://github.com/apollographql/apollo-client/pull/10999) [`c1904a78a`](https://github.com/apollographql/apollo-client/commit/c1904a78abb186f475303d632c2cb303bbd8d4f9) Thanks [@phryneas](https://github.com/phryneas)! - Fix a bug in `QueryReference` where `this.resolve` or `this.reject` might be executed even if `undefined`. + +- [#10940](https://github.com/apollographql/apollo-client/pull/10940) [`1d38f128f`](https://github.com/apollographql/apollo-client/commit/1d38f128f325ea7092bd04fe3799ebbb6e8bdfdd) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Add support for the `skip` option in `useBackgroundQuery` and `useSuspenseQuery`. Setting this option to `true` will avoid a network request. + +- [#10672](https://github.com/apollographql/apollo-client/pull/10672) [`932252b0c`](https://github.com/apollographql/apollo-client/commit/932252b0c54792ec8c5095de1b42c005a91ffe6d) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Fix the compatibility between `useSuspenseQuery` and React's `useDeferredValue` and `startTransition` APIs to allow React to show stale UI while the changes to the variable cause the component to suspend. + + # Breaking change + + `nextFetchPolicy` support has been removed from `useSuspenseQuery`. If you are using this option, remove it, otherwise it will be ignored. + +- [#10916](https://github.com/apollographql/apollo-client/pull/10916) [`ea75e18de`](https://github.com/apollographql/apollo-client/commit/ea75e18dec3db090dd4ed3b2d249bf674b90ead4) Thanks [@alessbell](https://github.com/alessbell)! - Remove experimental labels from hooks, move to beta. + +- [#10964](https://github.com/apollographql/apollo-client/pull/10964) [`f33171506`](https://github.com/apollographql/apollo-client/commit/f331715066d65291b1f5df5e6fa2b6618dfc70b1) Thanks [@alessbell](https://github.com/alessbell)! - Fixes a bug in `BatchHttpLink` that removed variables from all requests by default. + +- [#10633](https://github.com/apollographql/apollo-client/pull/10633) [`90a06eeeb`](https://github.com/apollographql/apollo-client/commit/90a06eeeb5a50eb172f5c6211693ea051897d8f3) Thanks [@benjamn](https://github.com/benjamn)! - Fix type policy inheritance involving fuzzy `possibleTypes` + +- [#10754](https://github.com/apollographql/apollo-client/pull/10754) [`64b304862`](https://github.com/apollographql/apollo-client/commit/64b3048621de35bbfe9bdf47785a2d5583232830) Thanks [@sincraianul](https://github.com/sincraianul)! - Fix `includeUnusedVariables` option not working with `BatchHttpLink` + +- [#11018](https://github.com/apollographql/apollo-client/pull/11018) [`5618953f3`](https://github.com/apollographql/apollo-client/commit/5618953f332a10c7df1b385126ec714aa5809c48) Thanks [@jerelmiller](https://github.com/jerelmiller)! - `useBackgroundQuery` now uses its own options type called `BackgroundQueryHookOptions` rather than reusing `SuspenseQueryHookOptions`. + +- [#11035](https://github.com/apollographql/apollo-client/pull/11035) [`a3ab7456d`](https://github.com/apollographql/apollo-client/commit/a3ab7456d59be4a7beb58d0aff6d431c603448f5) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Incrementally re-render deferred queries after calling `refetch` or setting `skip` to `false` to match the behavior of the initial fetch. Previously, the hook would not re-render until the entire result had finished loading in these cases. + +- [#10399](https://github.com/apollographql/apollo-client/pull/10399) [`652a1ae08`](https://github.com/apollographql/apollo-client/commit/652a1ae0868e4a5b75b9ff656d26f57eeca1081a) Thanks [@alessbell](https://github.com/alessbell)! - Silence useLayoutEffect warning when useSuspenseQuery runs on server + +- [#10919](https://github.com/apollographql/apollo-client/pull/10919) [`f796ce1ac`](https://github.com/apollographql/apollo-client/commit/f796ce1ac72f31a951a1d0f0b78d19dd039a6398) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Fix an issue when using a link that relied on `operation.getContext` and `operation.setContext` would error out when it was declared after the `removeTypenameFromVariables` link. + +- [#10968](https://github.com/apollographql/apollo-client/pull/10968) [`b102390b2`](https://github.com/apollographql/apollo-client/commit/b102390b238e5ce083062541d98a00fc3a10e1e1) Thanks [@phryneas](https://github.com/phryneas)! - Use printed query for query deduplication. Cache `print` calls for GraphQL documents to speed up repeated operations. + +- [#11071](https://github.com/apollographql/apollo-client/pull/11071) [`4473e925a`](https://github.com/apollographql/apollo-client/commit/4473e925ac5d6a53dc2b34867f034eda1b05aa00) Thanks [@jerelmiller](https://github.com/jerelmiller)! - [#10509](https://github.com/apollographql/apollo-client/pull/10509) introduced some helpers for determining the type of operation for a GraphQL query. This imported the `OperationTypeNode` from graphql-js which is not available in GraphQL 14. To maintain compatibility with graphql-js v14, this has been reverted to use plain strings. + +- [#10766](https://github.com/apollographql/apollo-client/pull/10766) [`ffb179e55`](https://github.com/apollographql/apollo-client/commit/ffb179e5553fa6f9156ae0aaf782dfcbec7d08c7) Thanks [@jerelmiller](https://github.com/jerelmiller)! - More robust typings for the `data` property returned from `useSuspenseQuery` when using `returnPartialData: true` or an `errorPolicy` of `all` or `ignore`. `TData` now defaults to `unknown` instead of `any`. + +- [#10401](https://github.com/apollographql/apollo-client/pull/10401) [`3e5b41a75`](https://github.com/apollographql/apollo-client/commit/3e5b41a751673bb2120c0b624e22afd3b7b860e5) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Always throw network errors in `useSuspenseQuery` regardless of the set `errorPolicy`. + +- [#10877](https://github.com/apollographql/apollo-client/pull/10877) [`f40248598`](https://github.com/apollographql/apollo-client/commit/f402485985cc2551b51602c0bff213b7ffb856b9) Thanks [@phryneas](https://github.com/phryneas)! - Change an import in `useQuery` and `useMutation` that added an unnecessary runtime dependency on `@apollo/client/core`. This drastically reduces the bundle size of each the hooks. + +- [#10836](https://github.com/apollographql/apollo-client/pull/10836) [`6794893c2`](https://github.com/apollographql/apollo-client/commit/6794893c29cc945aa99f6fe54a9e4e70ec3e57fd) Thanks [@phryneas](https://github.com/phryneas)! - Remove the deprecated `returnPartialData` option from `useFragment` hook. + +- [#10656](https://github.com/apollographql/apollo-client/pull/10656) [`54c4d2f3c`](https://github.com/apollographql/apollo-client/commit/54c4d2f3c719654e38e537ec38f1cb415c7c3f58) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Ensure `refetch`, `fetchMore`, and `subscribeToMore` functions returned by `useSuspenseQuery` are referentially stable between renders, even as `data` is updated. + +- [#10324](https://github.com/apollographql/apollo-client/pull/10324) [`95eb228be`](https://github.com/apollographql/apollo-client/commit/95eb228bedc193a520604e351d1c455bfbedef06) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Add `@defer` support to `useSuspenseQuery`. + +- [#10888](https://github.com/apollographql/apollo-client/pull/10888) [`1562a2f5a`](https://github.com/apollographql/apollo-client/commit/1562a2f5a91cf577d9c89c4e84088a6bccc73c28) Thanks [@alessbell](https://github.com/alessbell)! - Updates dependency versions in `package.json` by bumping: + + - `@wry/context` to `^0.7.3` + - `@wry/equality` to `^0.5.6` + - `@wry/trie` to `^0.4.3` + - `optimism` to `^0.17.4` + + to 1. [fix sourcemap warnings](https://github.com/benjamn/wryware/pull/497) and 2. a Codesandbox [sandpack (in-browser) bundler transpilation bug](https://github.com/codesandbox/sandpack/issues/940) with an [upstream optimism workaround](https://github.com/benjamn/optimism/pull/550). + +- [#11010](https://github.com/apollographql/apollo-client/pull/11010) [`1051a9c88`](https://github.com/apollographql/apollo-client/commit/1051a9c888ba86511b7fcb80a26d3b3050359258) Thanks [@alessbell](https://github.com/alessbell)! - Hide queryRef in a Symbol in `useBackgroundQuery`s return value. + +- [#10758](https://github.com/apollographql/apollo-client/pull/10758) [`9def7421f`](https://github.com/apollographql/apollo-client/commit/9def7421f3d028c91fcaa7971878b3da8281424d) Thanks [@phryneas](https://github.com/phryneas)! - use `React.use` where available + +- [#11032](https://github.com/apollographql/apollo-client/pull/11032) [`6a4da900a`](https://github.com/apollographql/apollo-client/commit/6a4da900a1bc5da3524caabd64bb30945e66f675) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Throw errors in `useSuspenseQuery` for errors returned in incremental chunks when `errorPolicy` is `none`. This provides a more consistent behavior of the `errorPolicy` in the hook. + + ### Potentially breaking change + + Previously, if you issued a query with `@defer` and relied on `errorPolicy: 'none'` to set the `error` property returned from `useSuspenseQuery` when the error was returned in an incremental chunk, this error is now thrown. Switch the `errorPolicy` to `all` to avoid throwing the error and instead return it in the `error` property. + +- [#10960](https://github.com/apollographql/apollo-client/pull/10960) [`ee407ef97`](https://github.com/apollographql/apollo-client/commit/ee407ef97317bf29c554732237aaf11552e06b01) Thanks [@alessbell](https://github.com/alessbell)! - Adds support for `returnPartialData` and `refetchWritePolicy` options in `useBackgroundQuery` hook. + +- [#10809](https://github.com/apollographql/apollo-client/pull/10809) [`49d28f764`](https://github.com/apollographql/apollo-client/commit/49d28f764980d132089ef8f6beca6e766b6120c0) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Fixed the ability to use `refetch` and `fetchMore` with React's `startTransition`. The hook will now behave correctly by allowing React to avoid showing the Suspense fallback when these functions are wrapped by `startTransition`. This change deprecates the `suspensePolicy` option in favor of `startTransition`. + +- [#11082](https://github.com/apollographql/apollo-client/pull/11082) [`0f1cde3a2`](https://github.com/apollographql/apollo-client/commit/0f1cde3a207699edb742dfaada817a815488d594) Thanks [@phryneas](https://github.com/phryneas)! - Restore Apollo Client 3.7 `getApolloContext` behaviour + +- [#10969](https://github.com/apollographql/apollo-client/pull/10969) [`525a9317a`](https://github.com/apollographql/apollo-client/commit/525a9317af729309f699fd6f8b787647a5f63eac) Thanks [@phryneas](https://github.com/phryneas)! - Slightly decrease bundle size and memory footprint of `SuspenseCache` by changing how cache entries are stored internally. + +- [#11025](https://github.com/apollographql/apollo-client/pull/11025) [`6092b6edf`](https://github.com/apollographql/apollo-client/commit/6092b6edf67ef311954c18c778ed0bdca1b77258) Thanks [@jerelmiller](https://github.com/jerelmiller)! - `useSuspenseQuery` and `useBackgroundQuery` will now properly apply changes to its options between renders. + +- [#10872](https://github.com/apollographql/apollo-client/pull/10872) [`96b4f8837`](https://github.com/apollographql/apollo-client/commit/96b4f8837881db67e951272b775dc62282e50d49) Thanks [@phryneas](https://github.com/phryneas)! - The "per-React-Version-Singleton" ApolloContext is now stored on `globalThis`, not `React.createContext`, and throws an error message when accessed from React Server Components. + +- [#10450](https://github.com/apollographql/apollo-client/pull/10450) [`f8bc33387`](https://github.com/apollographql/apollo-client/commit/f8bc33387f66e28456aede53bae75694c9a7a45f) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Add support for the `subscribeToMore` and `client` fields returned in the `useSuspenseQuery` result. + ## 3.8.0-rc.2 ### Minor Changes diff --git a/package-lock.json b/package-lock.json index e398826679a..28de96ebc70 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@apollo/client", - "version": "3.7.17", + "version": "3.8.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@apollo/client", - "version": "3.7.17", + "version": "3.8.0", "hasInstallScript": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index 74d515e00d0..cb2d3df0a2e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@apollo/client", - "version": "3.7.17", + "version": "3.8.0", "description": "A fully-featured caching GraphQL client.", "private": true, "keywords": [