@apollo/client 3.9.0-rc.0 → 3.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +158 -170
- package/README.md +4 -0
- package/apollo-client.cjs +3 -2
- package/apollo-client.cjs.map +1 -1
- package/apollo-client.min.cjs +1 -1
- package/cache/core/types/DataProxy.d.ts +8 -16
- package/cache/core/types/DataProxy.js.map +1 -1
- package/cache/inmemory/types.d.ts +0 -1
- package/cache/inmemory/types.js.map +1 -1
- package/cache/inmemory/writeToStore.js.map +1 -1
- package/core/ApolloClient.d.ts +6 -1
- package/core/ApolloClient.js.map +1 -1
- package/core/ObservableQuery.d.ts +22 -0
- package/core/ObservableQuery.js +22 -0
- package/core/ObservableQuery.js.map +1 -1
- package/core/core.cjs +1 -1
- package/core/core.cjs.map +1 -1
- package/core/core.cjs.native.js +1 -1
- package/core/types.d.ts +5 -2
- package/core/types.js.map +1 -1
- package/core/watchQueryOptions.d.ts +258 -128
- package/core/watchQueryOptions.js.map +1 -1
- package/dev/dev.cjs +2 -2
- package/dev/dev.cjs.map +1 -1
- package/dev/dev.cjs.native.js +2 -2
- package/invariantErrorCodes.js +1 -1
- package/package.json +18 -18
- package/react/components/types.d.ts +3 -0
- package/react/components/types.js.map +1 -1
- package/react/hooks/hooks.cjs.map +1 -1
- package/react/hooks/useApolloClient.d.ts +15 -0
- package/react/hooks/useApolloClient.js +15 -0
- package/react/hooks/useApolloClient.js.map +1 -1
- package/react/hooks/useLazyQuery.d.ts +35 -0
- package/react/hooks/useLazyQuery.js +35 -0
- package/react/hooks/useLazyQuery.js.map +1 -1
- package/react/hooks/useLoadableQuery.d.ts +69 -2
- package/react/hooks/useLoadableQuery.js.map +1 -1
- package/react/hooks/useMutation.d.ts +47 -0
- package/react/hooks/useMutation.js +47 -0
- package/react/hooks/useMutation.js.map +1 -1
- package/react/hooks/useQuery.d.ts +34 -0
- package/react/hooks/useQuery.js +34 -0
- package/react/hooks/useQuery.js.map +1 -1
- package/react/hooks/useQueryRefHandlers.d.ts +5 -4
- package/react/hooks/useQueryRefHandlers.js +1 -1
- package/react/hooks/useQueryRefHandlers.js.map +1 -1
- package/react/hooks/useReactiveVar.d.ts +17 -0
- package/react/hooks/useReactiveVar.js +17 -0
- package/react/hooks/useReactiveVar.js.map +1 -1
- package/react/hooks/useSubscription.d.ts +85 -0
- package/react/hooks/useSubscription.js +85 -0
- package/react/hooks/useSubscription.js.map +1 -1
- package/react/internal/cache/QueryReference.d.ts +39 -0
- package/react/internal/cache/QueryReference.js +2 -1
- package/react/internal/cache/QueryReference.js.map +1 -1
- package/react/internal/internal.cjs +2 -1
- package/react/internal/internal.cjs.map +1 -1
- package/react/internal/internal.cjs.native.js +2 -1
- package/react/query-preloader/createQueryPreloader.d.ts +84 -52
- package/react/query-preloader/createQueryPreloader.js +5 -2
- package/react/query-preloader/createQueryPreloader.js.map +1 -1
- package/react/react.cjs.map +1 -1
- package/react/types/types.d.ts +552 -57
- package/react/types/types.documentation.d.ts +559 -0
- package/react/types/types.documentation.js +2 -0
- package/react/types/types.documentation.js.map +1 -0
- package/react/types/types.js.map +1 -1
- package/utilities/globals/globals.cjs +1 -1
- package/utilities/globals/globals.cjs.map +1 -1
- package/utilities/globals/globals.cjs.native.js +1 -1
- package/utilities/graphql/DocumentTransform.d.ts +12 -0
- package/utilities/graphql/DocumentTransform.js.map +1 -1
- package/version.js +1 -1
- package/.changeset/beige-geese-wink.md +0 -5
- package/.changeset/breezy-spiders-tap.md +0 -38
- package/.changeset/chatty-comics-yawn.md +0 -8
- package/.changeset/clean-items-smash.md +0 -5
- package/.changeset/cold-llamas-turn.md +0 -8
- package/.changeset/curvy-seas-hope.md +0 -13
- package/.changeset/dirty-kids-crash.md +0 -5
- package/.changeset/dirty-tigers-matter.md +0 -13
- package/.changeset/forty-cups-shop.md +0 -5
- package/.changeset/friendly-clouds-laugh.md +0 -7
- package/.changeset/hot-ducks-burn.md +0 -5
- package/.changeset/late-rabbits-protect.md +0 -7
- package/.changeset/mighty-coats-check.md +0 -47
- package/.changeset/pink-apricots-yawn.md +0 -5
- package/.changeset/polite-avocados-warn.md +0 -5
- package/.changeset/pre.json +0 -44
- package/.changeset/quick-hats-marry.md +0 -5
- package/.changeset/rare-snakes-melt.md +0 -24
- package/.changeset/shaggy-ears-scream.md +0 -5
- package/.changeset/shaggy-sheep-pull.md +0 -5
- package/.changeset/sixty-boxes-rest.md +0 -8
- package/.changeset/smooth-plums-shout.md +0 -5
- package/.changeset/sour-sheep-walk.md +0 -7
- package/.changeset/spicy-drinks-camp.md +0 -5
- package/.changeset/strong-terms-perform.md +0 -46
- package/.changeset/swift-zoos-collect.md +0 -19
- package/.changeset/thick-mice-collect.md +0 -5
- package/.changeset/thick-tips-cry.md +0 -9
- package/.changeset/thirty-ties-arrive.md +0 -26
- package/.changeset/tough-timers-begin.md +0 -8
- package/.changeset/unlucky-rats-decide.md +0 -5
- package/.changeset/violet-lions-draw.md +0 -5
- package/.changeset/wet-forks-rhyme.md +0 -5
- package/.changeset/wild-dolphins-jog.md +0 -5
- package/.changeset/wise-news-grab.md +0 -7
- package/.changeset/yellow-flies-repeat.md +0 -5
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
"@apollo/client": patch
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
Persisted Query Link: improve memory management
|
|
6
|
-
* use LRU `WeakCache` instead of `WeakMap` to keep a limited number of hash results
|
|
7
|
-
* hash cache is initiated lazily, only when needed
|
|
8
|
-
* expose `persistedLink.resetHashCache()` method
|
|
9
|
-
* reset hash cache if the upstream server reports it doesn't accept persisted queries
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
"@apollo/client": minor
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
Introduces a new `useLoadableQuery` hook. This hook works similarly to `useBackgroundQuery` in that it returns a `queryRef` that can be used to suspend a component via the `useReadQuery` hook. It provides a more ergonomic way to load the query during a user interaction (for example when wanting to preload some data) that would otherwise be clunky with `useBackgroundQuery`.
|
|
6
|
-
|
|
7
|
-
```tsx
|
|
8
|
-
function App() {
|
|
9
|
-
const [loadQuery, queryRef, { refetch, fetchMore, reset }] = useLoadableQuery(query, options)
|
|
10
|
-
|
|
11
|
-
return (
|
|
12
|
-
<>
|
|
13
|
-
<button onClick={() => loadQuery(variables)}>Load query</button>
|
|
14
|
-
<Suspense fallback={<SuspenseFallback />}>
|
|
15
|
-
{queryRef && <Child queryRef={queryRef} />}
|
|
16
|
-
</Suspense>
|
|
17
|
-
</>
|
|
18
|
-
);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
function Child({ queryRef }) {
|
|
22
|
-
const { data } = useReadQuery(queryRef)
|
|
23
|
-
|
|
24
|
-
// ...
|
|
25
|
-
}
|
|
26
|
-
```
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
"@apollo/client": minor
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
Deprecates `canonizeResults`.
|
|
6
|
-
|
|
7
|
-
Using `canonizeResults` can result in memory leaks so we generally do not recommend using this option anymore.
|
|
8
|
-
A future version of Apollo Client will contain a similar feature without the risk of memory leaks.
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
'@apollo/client': minor
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
Remove the need to call `retain` from `useBackgroundQuery` since `useReadQuery` will now retain the query. This means that a `queryRef` that is not consumed by `useReadQuery` within the given `autoDisposeTimeoutMs` will now be auto diposed for you.
|
|
6
|
-
|
|
7
|
-
Thanks to [#11412](https://github.com/apollographql/apollo-client/pull/11412), disposed query refs will be automatically resubscribed to the query when consumed by `useReadQuery` after it has been disposed.
|