@apollo/client 4.0.0-alpha.0 → 4.0.0-alpha.2
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/.changeset/clean-sheep-hide.md +6 -0
- package/.changeset/cool-bikes-shake.md +12 -0
- package/.changeset/cuddly-spiders-tie.md +5 -0
- package/.changeset/gorgeous-chefs-tap.md +5 -0
- package/.changeset/hip-vans-act.md +5 -0
- package/.changeset/nervous-goats-allow.md +5 -0
- package/.changeset/pre.json +12 -0
- package/.changeset/rare-houses-prove.md +5 -0
- package/.changeset/slimy-maps-press.md +5 -0
- package/.changeset/small-buttons-rhyme.md +5 -0
- package/.changeset/tall-bikes-develop.md +5 -0
- package/.changeset/tame-doors-shop.md +14 -0
- package/.changeset/young-phones-fold.md +5 -0
- package/CHANGELOG.md +53 -0
- package/__cjs/cache/core/cache.cjs +4 -4
- package/__cjs/cache/core/cache.cjs.map +1 -1
- package/__cjs/cache/core/cache.d.cts +18 -18
- package/__cjs/cache/core/types/Cache.cjs.map +1 -1
- package/__cjs/cache/core/types/Cache.d.cts +9 -16
- package/__cjs/cache/core/types/DataProxy.d.cts +8 -23
- package/__cjs/cache/inmemory/entityStore.cjs +5 -7
- package/__cjs/cache/inmemory/entityStore.cjs.map +1 -1
- package/__cjs/cache/inmemory/entityStore.d.cts +2 -2
- package/__cjs/cache/inmemory/fragmentRegistry.cjs +3 -3
- package/__cjs/cache/inmemory/fragmentRegistry.cjs.map +1 -1
- package/__cjs/cache/inmemory/helpers.cjs +0 -8
- package/__cjs/cache/inmemory/helpers.cjs.map +1 -1
- package/__cjs/cache/inmemory/helpers.d.cts +3 -4
- package/__cjs/cache/inmemory/inMemoryCache.cjs +6 -18
- package/__cjs/cache/inmemory/inMemoryCache.cjs.map +1 -1
- package/__cjs/cache/inmemory/inMemoryCache.d.cts +8 -10
- package/__cjs/cache/inmemory/key-extractor.cjs +1 -1
- package/__cjs/cache/inmemory/policies.cjs +9 -9
- package/__cjs/cache/inmemory/policies.cjs.map +1 -1
- package/__cjs/cache/inmemory/policies.d.cts +1 -1
- package/__cjs/cache/inmemory/reactiveVars.cjs.map +1 -1
- package/__cjs/cache/inmemory/reactiveVars.d.cts +6 -6
- package/__cjs/cache/inmemory/readFromStore.cjs +14 -56
- package/__cjs/cache/inmemory/readFromStore.cjs.map +1 -1
- package/__cjs/cache/inmemory/readFromStore.d.cts +1 -6
- package/__cjs/cache/inmemory/types.d.cts +3 -17
- package/__cjs/cache/inmemory/writeToStore.cjs +8 -8
- package/__cjs/cache/inmemory/writeToStore.cjs.map +1 -1
- package/__cjs/cache/inmemory/writeToStore.d.cts +2 -2
- package/__cjs/core/ApolloClient.cjs +5 -5
- package/__cjs/core/ApolloClient.cjs.map +1 -1
- package/__cjs/core/ApolloClient.d.cts +19 -19
- package/__cjs/core/LocalState.cjs +2 -2
- package/__cjs/core/LocalState.cjs.map +1 -1
- package/__cjs/core/LocalState.d.cts +8 -8
- package/__cjs/core/ObservableQuery.cjs +5 -5
- package/__cjs/core/ObservableQuery.cjs.map +1 -1
- package/__cjs/core/ObservableQuery.d.cts +4 -4
- package/__cjs/core/QueryInfo.cjs +0 -1
- package/__cjs/core/QueryInfo.cjs.map +1 -1
- package/__cjs/core/QueryInfo.d.cts +1 -1
- package/__cjs/core/QueryManager.cjs +12 -12
- package/__cjs/core/QueryManager.cjs.map +1 -1
- package/__cjs/core/QueryManager.d.cts +26 -16
- package/__cjs/core/types.d.cts +4 -4
- package/__cjs/core/watchQueryOptions.d.cts +10 -26
- package/__cjs/invariantErrorCodes.cjs +44 -38
- package/__cjs/link/batch/batching.cjs.map +1 -1
- package/__cjs/link/core/ApolloLink.cjs +2 -2
- package/__cjs/link/http/createHttpLink.d.cts +2 -1
- package/__cjs/link/http/parseAndCheckHttpResponse.cjs +4 -3
- package/__cjs/link/http/parseAndCheckHttpResponse.cjs.map +1 -1
- package/__cjs/link/http/serializeFetchParameter.cjs +1 -1
- package/__cjs/link/persisted-queries/index.cjs +1 -1
- package/__cjs/link/persisted-queries/index.cjs.map +1 -1
- package/__cjs/link/persisted-queries/index.d.cts +12 -1
- package/__cjs/link/remove-typename/removeTypenameFromVariables.cjs +1 -1
- package/__cjs/link/remove-typename/removeTypenameFromVariables.cjs.map +1 -1
- package/__cjs/link/remove-typename/removeTypenameFromVariables.d.cts +10 -1
- package/__cjs/masking/maskDefinition.cjs.map +1 -1
- package/__cjs/masking/maskDefinition.d.cts +1 -1
- package/__cjs/masking/maskFragment.cjs.map +1 -1
- package/__cjs/masking/maskFragment.d.cts +1 -1
- package/__cjs/masking/maskOperation.cjs.map +1 -1
- package/__cjs/masking/maskOperation.d.cts +1 -1
- package/__cjs/react/context/ApolloConsumer.cjs +1 -1
- package/__cjs/react/context/ApolloConsumer.cjs.map +1 -1
- package/__cjs/react/context/ApolloConsumer.d.cts +1 -1
- package/__cjs/react/context/ApolloContext.cjs +1 -1
- package/__cjs/react/context/ApolloContext.cjs.map +1 -1
- package/__cjs/react/context/ApolloContext.d.cts +1 -1
- package/__cjs/react/context/ApolloProvider.cjs +1 -1
- package/__cjs/react/context/ApolloProvider.cjs.map +1 -1
- package/__cjs/react/context/ApolloProvider.d.cts +3 -3
- package/__cjs/react/hooks/internal/__use.cjs +1 -1
- package/__cjs/react/hooks/internal/__use.cjs.map +1 -1
- package/__cjs/react/hooks/internal/__use.d.cts +3 -1
- package/__cjs/react/hooks/internal/useDeepMemo.cjs +3 -1
- package/__cjs/react/hooks/internal/useDeepMemo.cjs.map +1 -1
- package/__cjs/react/hooks/internal/useIsomorphicLayoutEffect.cjs +1 -1
- package/__cjs/react/hooks/internal/useIsomorphicLayoutEffect.cjs.map +1 -1
- package/__cjs/react/hooks/internal/useIsomorphicLayoutEffect.d.cts +2 -2
- package/__cjs/react/hooks/internal/useRenderGuard.cjs +1 -1
- package/__cjs/react/hooks/internal/useRenderGuard.cjs.map +1 -1
- package/__cjs/react/hooks/internal/wrapHook.cjs.map +1 -1
- package/__cjs/react/hooks/internal/wrapHook.d.cts +1 -1
- package/__cjs/react/hooks/useApolloClient.cjs +1 -1
- package/__cjs/react/hooks/useApolloClient.cjs.map +1 -1
- package/__cjs/react/hooks/useApolloClient.d.cts +1 -1
- package/__cjs/react/hooks/useBackgroundQuery.cjs +1 -1
- package/__cjs/react/hooks/useBackgroundQuery.cjs.map +1 -1
- package/__cjs/react/hooks/useFragment.cjs +1 -1
- package/__cjs/react/hooks/useFragment.cjs.map +1 -1
- package/__cjs/react/hooks/useFragment.d.cts +3 -3
- package/__cjs/react/hooks/useLazyQuery.cjs +6 -4
- package/__cjs/react/hooks/useLazyQuery.cjs.map +1 -1
- package/__cjs/react/hooks/useLazyQuery.d.cts +4 -12
- package/__cjs/react/hooks/useLoadableQuery.cjs +1 -1
- package/__cjs/react/hooks/useLoadableQuery.cjs.map +1 -1
- package/__cjs/react/hooks/useMutation.cjs +1 -2
- package/__cjs/react/hooks/useMutation.cjs.map +1 -1
- package/__cjs/react/hooks/useMutation.d.cts +1 -1
- package/__cjs/react/hooks/useQuery.cjs +12 -21
- package/__cjs/react/hooks/useQuery.cjs.map +1 -1
- package/__cjs/react/hooks/useQuery.d.cts +1 -1
- package/__cjs/react/hooks/useQueryRefHandlers.cjs +1 -1
- package/__cjs/react/hooks/useQueryRefHandlers.cjs.map +1 -1
- package/__cjs/react/hooks/useReactiveVar.cjs +1 -1
- package/__cjs/react/hooks/useReactiveVar.cjs.map +1 -1
- package/__cjs/react/hooks/useReadQuery.cjs +1 -1
- package/__cjs/react/hooks/useReadQuery.cjs.map +1 -1
- package/__cjs/react/hooks/useSubscription.cjs +2 -1
- package/__cjs/react/hooks/useSubscription.cjs.map +1 -1
- package/__cjs/react/hooks/useSubscription.d.cts +7 -1
- package/__cjs/react/hooks/useSuspenseFragment.cjs +1 -1
- package/__cjs/react/hooks/useSuspenseFragment.cjs.map +1 -1
- package/__cjs/react/hooks/useSuspenseFragment.d.cts +1 -1
- package/__cjs/react/hooks/useSuspenseQuery.cjs +1 -1
- package/__cjs/react/hooks/useSuspenseQuery.cjs.map +1 -1
- package/__cjs/react/hooks/useSuspenseQuery.d.cts +2 -2
- package/__cjs/react/hooks/useSyncExternalStore.cjs +1 -1
- package/__cjs/react/hooks/useSyncExternalStore.cjs.map +1 -1
- package/__cjs/react/index.react-server.cjs +52 -0
- package/__cjs/react/index.react-server.cjs.map +1 -0
- package/__cjs/react/index.react-server.d.cts +20 -0
- package/__cjs/react/internal/cache/FragmentReference.cjs.map +1 -1
- package/__cjs/react/internal/cache/FragmentReference.d.cts +3 -3
- package/__cjs/react/internal/cache/QueryReference.cjs +1 -6
- package/__cjs/react/internal/cache/QueryReference.cjs.map +1 -1
- package/__cjs/react/internal/cache/QueryReference.d.cts +6 -6
- package/__cjs/react/internal/cache/SuspenseCache.cjs.map +1 -1
- package/__cjs/react/internal/cache/SuspenseCache.d.cts +3 -3
- package/__cjs/react/internal/cache/getSuspenseCache.cjs.map +1 -1
- package/__cjs/react/internal/cache/getSuspenseCache.d.cts +2 -2
- package/__cjs/react/parser/index.cjs +3 -3
- package/__cjs/react/parser/index.cjs.map +1 -1
- package/__cjs/react/query-preloader/createQueryPreloader.cjs.map +1 -1
- package/__cjs/react/query-preloader/createQueryPreloader.d.cts +1 -9
- package/__cjs/react/ssr/getDataFromTree.cjs +1 -1
- package/__cjs/react/ssr/getDataFromTree.cjs.map +1 -1
- package/__cjs/react/types/types.d.cts +31 -49
- package/__cjs/react/types/types.documentation.d.cts +0 -12
- package/__cjs/testing/core/mocking/mockClient.cjs.map +1 -1
- package/__cjs/testing/core/mocking/mockClient.d.cts +1 -2
- package/__cjs/testing/core/mocking/mockLink.cjs.map +1 -1
- package/__cjs/testing/internal/disposables/withProdMode.d.cts +1 -1
- package/__cjs/testing/internal/incremental.d.cts +3 -2
- package/__cjs/testing/internal/renderHelpers.cjs.map +1 -1
- package/__cjs/testing/internal/renderHelpers.d.cts +2 -2
- package/__cjs/testing/internal/scenarios/index.d.cts +16 -5
- package/__cjs/testing/react/MockedProvider.cjs.map +1 -1
- package/__cjs/testing/react/MockedProvider.d.cts +3 -3
- package/__cjs/utilities/common/canonicalStringify.cjs +2 -2
- package/__cjs/utilities/common/canonicalStringify.cjs.map +1 -1
- package/__cjs/utilities/common/errorHandling.d.cts +1 -1
- package/__cjs/utilities/common/maybeDeepFreeze.cjs +1 -0
- package/__cjs/utilities/common/maybeDeepFreeze.cjs.map +1 -1
- package/__cjs/utilities/common/maybeDeepFreeze.d.cts +1 -0
- package/__cjs/utilities/graphql/print.cjs +2 -2
- package/__cjs/utilities/graphql/print.cjs.map +1 -1
- package/__cjs/utilities/{caching → internal}/getMemoryInternals.cjs +1 -1
- package/__cjs/utilities/internal/getMemoryInternals.cjs.map +1 -0
- package/__cjs/utilities/{caching → internal}/getMemoryInternals.d.cts +1 -1
- package/__cjs/utilities/internal/index.cjs +6 -1
- package/__cjs/utilities/internal/index.cjs.map +1 -1
- package/__cjs/utilities/internal/index.d.cts +1 -0
- package/__cjs/utilities/internal/index.production.cjs +10 -0
- package/__cjs/utilities/internal/index.production.cjs.map +1 -0
- package/__cjs/utilities/internal/index.production.d.cts +3 -0
- package/__cjs/utilities/types/NoInfer.d.cts +1 -1
- package/__cjs/version.cjs +1 -1
- package/__cjs/version.d.cts +1 -1
- package/cache/core/cache.d.ts +18 -18
- package/cache/core/cache.js +2 -2
- package/cache/core/cache.js.map +1 -1
- package/cache/core/types/Cache.d.ts +9 -16
- package/cache/core/types/Cache.js.map +1 -1
- package/cache/core/types/DataProxy.d.ts +8 -23
- package/cache/inmemory/entityStore.d.ts +2 -2
- package/cache/inmemory/entityStore.js +5 -7
- package/cache/inmemory/entityStore.js.map +1 -1
- package/cache/inmemory/helpers.d.ts +0 -1
- package/cache/inmemory/helpers.js +0 -7
- package/cache/inmemory/helpers.js.map +1 -1
- package/cache/inmemory/inMemoryCache.d.ts +8 -10
- package/cache/inmemory/inMemoryCache.js +5 -17
- package/cache/inmemory/inMemoryCache.js.map +1 -1
- package/cache/inmemory/key-extractor.js +1 -1
- package/cache/inmemory/policies.d.ts +1 -1
- package/cache/inmemory/policies.js +9 -9
- package/cache/inmemory/policies.js.map +1 -1
- package/cache/inmemory/reactiveVars.d.ts +6 -6
- package/cache/inmemory/reactiveVars.js.map +1 -1
- package/cache/inmemory/readFromStore.d.ts +1 -6
- package/cache/inmemory/readFromStore.js +14 -56
- package/cache/inmemory/readFromStore.js.map +1 -1
- package/cache/inmemory/types.d.ts +3 -17
- package/cache/inmemory/writeToStore.d.ts +2 -2
- package/cache/inmemory/writeToStore.js +8 -8
- package/cache/inmemory/writeToStore.js.map +1 -1
- package/core/ApolloClient.d.ts +19 -19
- package/core/ApolloClient.js +4 -4
- package/core/ApolloClient.js.map +1 -1
- package/core/LocalState.d.ts +6 -6
- package/core/LocalState.js +2 -2
- package/core/LocalState.js.map +1 -1
- package/core/ObservableQuery.d.ts +3 -3
- package/core/ObservableQuery.js +5 -5
- package/core/ObservableQuery.js.map +1 -1
- package/core/QueryInfo.d.ts +1 -1
- package/core/QueryInfo.js +0 -1
- package/core/QueryInfo.js.map +1 -1
- package/core/QueryManager.d.ts +13 -13
- package/core/QueryManager.js +11 -11
- package/core/QueryManager.js.map +1 -1
- package/core/types.d.ts +4 -4
- package/core/watchQueryOptions.d.ts +10 -26
- package/invariantErrorCodes.js +44 -38
- package/link/batch/batching.js +1 -1
- package/link/batch/batching.js.map +1 -1
- package/link/core/ApolloLink.js +2 -2
- package/link/http/parseAndCheckHttpResponse.js +4 -3
- package/link/http/parseAndCheckHttpResponse.js.map +1 -1
- package/link/http/serializeFetchParameter.js +1 -1
- package/masking/maskDefinition.d.ts +1 -1
- package/masking/maskDefinition.js.map +1 -1
- package/masking/maskFragment.d.ts +1 -1
- package/masking/maskFragment.js.map +1 -1
- package/masking/maskOperation.d.ts +1 -1
- package/masking/maskOperation.js.map +1 -1
- package/package.json +39 -17
- package/react/context/ApolloConsumer.d.ts +1 -1
- package/react/context/ApolloConsumer.js +1 -1
- package/react/context/ApolloConsumer.js.map +1 -1
- package/react/context/ApolloContext.d.ts +1 -1
- package/react/context/ApolloContext.js +1 -1
- package/react/context/ApolloContext.js.map +1 -1
- package/react/context/ApolloProvider.d.ts +3 -3
- package/react/context/ApolloProvider.js +1 -1
- package/react/context/ApolloProvider.js.map +1 -1
- package/react/hooks/internal/__use.js +1 -1
- package/react/hooks/internal/__use.js.map +1 -1
- package/react/hooks/internal/useDeepMemo.js +3 -1
- package/react/hooks/internal/useDeepMemo.js.map +1 -1
- package/react/hooks/internal/useIsomorphicLayoutEffect.d.ts +1 -1
- package/react/hooks/internal/useIsomorphicLayoutEffect.js +1 -1
- package/react/hooks/internal/useIsomorphicLayoutEffect.js.map +1 -1
- package/react/hooks/internal/useRenderGuard.js +1 -1
- package/react/hooks/internal/useRenderGuard.js.map +1 -1
- package/react/hooks/internal/wrapHook.d.ts +1 -1
- package/react/hooks/internal/wrapHook.js.map +1 -1
- package/react/hooks/useApolloClient.d.ts +1 -1
- package/react/hooks/useApolloClient.js +1 -1
- package/react/hooks/useApolloClient.js.map +1 -1
- package/react/hooks/useBackgroundQuery.js +1 -1
- package/react/hooks/useBackgroundQuery.js.map +1 -1
- package/react/hooks/useFragment.d.ts +3 -3
- package/react/hooks/useFragment.js +1 -1
- package/react/hooks/useFragment.js.map +1 -1
- package/react/hooks/useLazyQuery.d.ts +4 -12
- package/react/hooks/useLazyQuery.js +6 -4
- package/react/hooks/useLazyQuery.js.map +1 -1
- package/react/hooks/useLoadableQuery.js +1 -1
- package/react/hooks/useLoadableQuery.js.map +1 -1
- package/react/hooks/useMutation.d.ts +1 -1
- package/react/hooks/useMutation.js +1 -2
- package/react/hooks/useMutation.js.map +1 -1
- package/react/hooks/useQuery.d.ts +1 -1
- package/react/hooks/useQuery.js +12 -21
- package/react/hooks/useQuery.js.map +1 -1
- package/react/hooks/useQueryRefHandlers.js +1 -1
- package/react/hooks/useQueryRefHandlers.js.map +1 -1
- package/react/hooks/useReactiveVar.js +1 -1
- package/react/hooks/useReactiveVar.js.map +1 -1
- package/react/hooks/useReadQuery.js +1 -1
- package/react/hooks/useReadQuery.js.map +1 -1
- package/react/hooks/useSubscription.d.ts +1 -1
- package/react/hooks/useSubscription.js +2 -1
- package/react/hooks/useSubscription.js.map +1 -1
- package/react/hooks/useSuspenseFragment.d.ts +1 -1
- package/react/hooks/useSuspenseFragment.js +1 -1
- package/react/hooks/useSuspenseFragment.js.map +1 -1
- package/react/hooks/useSuspenseQuery.d.ts +2 -2
- package/react/hooks/useSuspenseQuery.js +1 -1
- package/react/hooks/useSuspenseQuery.js.map +1 -1
- package/react/hooks/useSyncExternalStore.js +1 -1
- package/react/hooks/useSyncExternalStore.js.map +1 -1
- package/react/index.react-server.d.ts +20 -0
- package/react/index.react-server.js +46 -0
- package/react/index.react-server.js.map +1 -0
- package/react/internal/cache/FragmentReference.d.ts +3 -3
- package/react/internal/cache/FragmentReference.js.map +1 -1
- package/react/internal/cache/QueryReference.d.ts +1 -1
- package/react/internal/cache/QueryReference.js +1 -6
- package/react/internal/cache/QueryReference.js.map +1 -1
- package/react/internal/cache/SuspenseCache.d.ts +3 -3
- package/react/internal/cache/SuspenseCache.js.map +1 -1
- package/react/internal/cache/getSuspenseCache.d.ts +1 -1
- package/react/internal/cache/getSuspenseCache.js.map +1 -1
- package/react/parser/index.js +1 -1
- package/react/parser/index.js.map +1 -1
- package/react/query-preloader/createQueryPreloader.d.ts +1 -9
- package/react/query-preloader/createQueryPreloader.js.map +1 -1
- package/react/ssr/getDataFromTree.js +1 -1
- package/react/ssr/getDataFromTree.js.map +1 -1
- package/react/types/types.d.ts +31 -49
- package/react/types/types.documentation.d.ts +0 -12
- package/testing/core/mocking/mockClient.d.ts +1 -2
- package/testing/core/mocking/mockClient.js.map +1 -1
- package/testing/core/mocking/mockLink.js +1 -1
- package/testing/core/mocking/mockLink.js.map +1 -1
- package/testing/internal/renderHelpers.d.ts +2 -2
- package/testing/internal/renderHelpers.js.map +1 -1
- package/testing/react/MockedProvider.d.ts +3 -3
- package/testing/react/MockedProvider.js.map +1 -1
- package/utilities/common/canonicalStringify.js +1 -1
- package/utilities/common/canonicalStringify.js.map +1 -1
- package/utilities/common/maybeDeepFreeze.d.ts +1 -0
- package/utilities/common/maybeDeepFreeze.js +1 -0
- package/utilities/common/maybeDeepFreeze.js.map +1 -1
- package/utilities/graphql/print.js +1 -1
- package/utilities/graphql/print.js.map +1 -1
- package/utilities/{caching → internal}/getMemoryInternals.js +1 -1
- package/utilities/internal/getMemoryInternals.js.map +1 -0
- package/utilities/internal/index.d.ts +1 -0
- package/utilities/internal/index.js +1 -0
- package/utilities/internal/index.js.map +1 -1
- package/utilities/internal/index.production.d.ts +3 -0
- package/utilities/internal/index.production.js +6 -0
- package/utilities/internal/index.production.js.map +1 -0
- package/utilities/types/NoInfer.d.ts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/__cjs/cache/inmemory/fixPolyfills.cjs +0 -10
- package/__cjs/cache/inmemory/fixPolyfills.cjs.map +0 -1
- package/__cjs/cache/inmemory/fixPolyfills.d.cts +0 -2
- package/__cjs/cache/inmemory/fixPolyfills.native.cjs +0 -53
- package/__cjs/cache/inmemory/fixPolyfills.native.cjs.map +0 -1
- package/__cjs/cache/inmemory/fixPolyfills.native.d.cts +0 -2
- package/__cjs/cache/inmemory/object-canon.cjs +0 -180
- package/__cjs/cache/inmemory/object-canon.cjs.map +0 -1
- package/__cjs/cache/inmemory/object-canon.d.cts +0 -12
- package/__cjs/link/http/iterators/async.cjs +0 -19
- package/__cjs/link/http/iterators/async.cjs.map +0 -1
- package/__cjs/link/http/iterators/async.d.cts +0 -6
- package/__cjs/link/http/iterators/nodeStream.cjs +0 -75
- package/__cjs/link/http/iterators/nodeStream.cjs.map +0 -1
- package/__cjs/link/http/iterators/nodeStream.d.cts +0 -7
- package/__cjs/link/http/iterators/promise.cjs +0 -32
- package/__cjs/link/http/iterators/promise.cjs.map +0 -1
- package/__cjs/link/http/iterators/promise.d.cts +0 -6
- package/__cjs/link/http/iterators/reader.cjs +0 -19
- package/__cjs/link/http/iterators/reader.cjs.map +0 -1
- package/__cjs/link/http/iterators/reader.d.cts +0 -6
- package/__cjs/link/http/responseIterator.cjs +0 -50
- package/__cjs/link/http/responseIterator.cjs.map +0 -1
- package/__cjs/link/http/responseIterator.d.cts +0 -7
- package/__cjs/utilities/caching/getMemoryInternals.cjs.map +0 -1
- package/cache/inmemory/fixPolyfills.d.ts +0 -2
- package/cache/inmemory/fixPolyfills.js +0 -10
- package/cache/inmemory/fixPolyfills.js.map +0 -1
- package/cache/inmemory/fixPolyfills.native.d.ts +0 -2
- package/cache/inmemory/fixPolyfills.native.js +0 -53
- package/cache/inmemory/fixPolyfills.native.js.map +0 -1
- package/cache/inmemory/object-canon.d.ts +0 -12
- package/cache/inmemory/object-canon.js +0 -176
- package/cache/inmemory/object-canon.js.map +0 -1
- package/link/http/iterators/async.d.ts +0 -6
- package/link/http/iterators/async.js +0 -16
- package/link/http/iterators/async.js.map +0 -1
- package/link/http/iterators/nodeStream.d.ts +0 -7
- package/link/http/iterators/nodeStream.js +0 -72
- package/link/http/iterators/nodeStream.js.map +0 -1
- package/link/http/iterators/promise.d.ts +0 -6
- package/link/http/iterators/promise.js +0 -29
- package/link/http/iterators/promise.js.map +0 -1
- package/link/http/iterators/reader.d.ts +0 -6
- package/link/http/iterators/reader.js +0 -16
- package/link/http/iterators/reader.js.map +0 -1
- package/link/http/responseIterator.d.ts +0 -7
- package/link/http/responseIterator.js +0 -46
- package/link/http/responseIterator.js.map +0 -1
- package/utilities/caching/getMemoryInternals.js.map +0 -1
- /package/utilities/{caching → internal}/getMemoryInternals.d.ts +0 -0
|
@@ -1,30 +1,23 @@
|
|
|
1
|
+
import type { OperationVariables } from "@apollo/client/core";
|
|
1
2
|
import type { Unmasked } from "@apollo/client/masking";
|
|
2
3
|
import type { ApolloCache } from "../cache.cjs";
|
|
3
4
|
import type { AllFieldsModifier, Modifiers } from "./common.cjs";
|
|
4
5
|
import { DataProxy } from "./DataProxy.cjs";
|
|
5
6
|
export declare namespace Cache {
|
|
6
|
-
type WatchCallback<TData =
|
|
7
|
-
interface ReadOptions<TVariables =
|
|
7
|
+
type WatchCallback<TData = unknown> = (diff: Cache.DiffResult<TData>, lastDiff?: Cache.DiffResult<TData>) => void;
|
|
8
|
+
interface ReadOptions<TVariables = OperationVariables, TData = unknown> extends DataProxy.Query<TVariables, TData> {
|
|
8
9
|
rootId?: string;
|
|
9
10
|
previousResult?: any;
|
|
10
11
|
optimistic: boolean;
|
|
11
12
|
returnPartialData?: boolean;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
* Using `canonizeResults` can result in memory leaks so we generally do not
|
|
15
|
-
* recommend using this option anymore.
|
|
16
|
-
* A future version of Apollo Client will contain a similar feature without
|
|
17
|
-
* the risk of memory leaks.
|
|
18
|
-
*/
|
|
19
|
-
canonizeResults?: boolean;
|
|
20
|
-
}
|
|
21
|
-
interface WriteOptions<TResult = any, TVariables = any> extends Omit<DataProxy.Query<TVariables, TResult>, "id">, Omit<DataProxy.WriteOptions<TResult>, "data"> {
|
|
13
|
+
}
|
|
14
|
+
interface WriteOptions<TData = unknown, TVariables = OperationVariables> extends Omit<DataProxy.Query<TVariables, TData>, "id">, Omit<DataProxy.WriteOptions<TData>, "data"> {
|
|
22
15
|
dataId?: string;
|
|
23
|
-
result: Unmasked<
|
|
16
|
+
result: Unmasked<TData>;
|
|
24
17
|
}
|
|
25
|
-
interface DiffOptions<TData =
|
|
18
|
+
interface DiffOptions<TData = unknown, TVariables = OperationVariables> extends Omit<ReadOptions<TVariables, TData>, "rootId"> {
|
|
26
19
|
}
|
|
27
|
-
interface WatchOptions<TData =
|
|
20
|
+
interface WatchOptions<TData = unknown, TVariables = OperationVariables> extends DiffOptions<TData, TVariables> {
|
|
28
21
|
watcher?: object;
|
|
29
22
|
immediate?: boolean;
|
|
30
23
|
callback: WatchCallback<TData>;
|
|
@@ -45,7 +38,7 @@ export declare namespace Cache {
|
|
|
45
38
|
optimistic?: boolean;
|
|
46
39
|
broadcast?: boolean;
|
|
47
40
|
}
|
|
48
|
-
interface BatchOptions<TCache extends ApolloCache
|
|
41
|
+
interface BatchOptions<TCache extends ApolloCache, TUpdateResult = void> {
|
|
49
42
|
update(cache: TCache): TUpdateResult;
|
|
50
43
|
optimistic?: string | boolean;
|
|
51
44
|
removeOptimistic?: string;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { TypedDocumentNode } from "@graphql-typed-document-node/core";
|
|
2
2
|
import type { DocumentNode } from "graphql";
|
|
3
|
+
import type { OperationVariables } from "@apollo/client/core";
|
|
3
4
|
import type { Unmasked } from "@apollo/client/masking";
|
|
4
5
|
import type { DeepPartial, Reference } from "@apollo/client/utilities";
|
|
5
6
|
import type { MissingFieldError } from "./common.cjs";
|
|
@@ -59,14 +60,6 @@ export declare namespace DataProxy {
|
|
|
59
60
|
* readQuery method can be omitted. Defaults to false.
|
|
60
61
|
*/
|
|
61
62
|
optimistic?: boolean;
|
|
62
|
-
/**
|
|
63
|
-
* Whether to canonize cache results before returning them. Canonization takes some extra time, but it speeds up future deep equality comparisons. Defaults to false.
|
|
64
|
-
*
|
|
65
|
-
* @deprecated
|
|
66
|
-
*
|
|
67
|
-
* Using `canonizeResults` can result in memory leaks so we generally do not recommend using this option anymore. A future version of Apollo Client will contain a similar feature without the risk of memory leaks.
|
|
68
|
-
*/
|
|
69
|
-
canonizeResults?: boolean;
|
|
70
63
|
}
|
|
71
64
|
interface ReadFragmentOptions<TData, TVariables> extends Fragment<TVariables, TData> {
|
|
72
65
|
/**
|
|
@@ -80,14 +73,6 @@ export declare namespace DataProxy {
|
|
|
80
73
|
* readQuery method can be omitted. Defaults to false.
|
|
81
74
|
*/
|
|
82
75
|
optimistic?: boolean;
|
|
83
|
-
/**
|
|
84
|
-
* Whether to canonize cache results before returning them. Canonization takes some extra time, but it speeds up future deep equality comparisons. Defaults to false.
|
|
85
|
-
*
|
|
86
|
-
* @deprecated
|
|
87
|
-
*
|
|
88
|
-
* Using `canonizeResults` can result in memory leaks so we generally do not recommend using this option anymore. A future version of Apollo Client will contain a similar feature without the risk of memory leaks.
|
|
89
|
-
*/
|
|
90
|
-
canonizeResults?: boolean;
|
|
91
76
|
}
|
|
92
77
|
interface WriteOptions<TData> {
|
|
93
78
|
/**
|
|
@@ -112,13 +97,13 @@ export declare namespace DataProxy {
|
|
|
112
97
|
}
|
|
113
98
|
interface UpdateFragmentOptions<TData, TVariables> extends Omit<ReadFragmentOptions<TData, TVariables> & WriteFragmentOptions<TData, TVariables>, "data"> {
|
|
114
99
|
}
|
|
115
|
-
type DiffResult<
|
|
116
|
-
result:
|
|
100
|
+
type DiffResult<TData> = {
|
|
101
|
+
result: TData;
|
|
117
102
|
complete: true;
|
|
118
103
|
missing?: never;
|
|
119
104
|
fromOptimisticTransaction?: boolean;
|
|
120
105
|
} | {
|
|
121
|
-
result: DeepPartial<
|
|
106
|
+
result: DeepPartial<TData> | null;
|
|
122
107
|
complete: false;
|
|
123
108
|
missing?: MissingFieldError;
|
|
124
109
|
fromOptimisticTransaction?: boolean;
|
|
@@ -134,22 +119,22 @@ export interface DataProxy {
|
|
|
134
119
|
/**
|
|
135
120
|
* Reads a GraphQL query from the root query id.
|
|
136
121
|
*/
|
|
137
|
-
readQuery<
|
|
122
|
+
readQuery<TData = unknown, TVariables = OperationVariables>(options: DataProxy.ReadQueryOptions<TData, TVariables>, optimistic?: boolean): Unmasked<TData> | null;
|
|
138
123
|
/**
|
|
139
124
|
* Reads a GraphQL fragment from any arbitrary id. If there is more than
|
|
140
125
|
* one fragment in the provided document then a `fragmentName` must be
|
|
141
126
|
* provided to select the correct fragment.
|
|
142
127
|
*/
|
|
143
|
-
readFragment<
|
|
128
|
+
readFragment<TData = unknown, TVariables = OperationVariables>(options: DataProxy.ReadFragmentOptions<TData, TVariables>, optimistic?: boolean): Unmasked<TData> | null;
|
|
144
129
|
/**
|
|
145
130
|
* Writes a GraphQL query to the root query id.
|
|
146
131
|
*/
|
|
147
|
-
writeQuery<TData =
|
|
132
|
+
writeQuery<TData = unknown, TVariables = OperationVariables>(options: DataProxy.WriteQueryOptions<TData, TVariables>): Reference | undefined;
|
|
148
133
|
/**
|
|
149
134
|
* Writes a GraphQL fragment to any arbitrary id. If there is more than
|
|
150
135
|
* one fragment in the provided document then a `fragmentName` must be
|
|
151
136
|
* provided to select the correct fragment.
|
|
152
137
|
*/
|
|
153
|
-
writeFragment<TData =
|
|
138
|
+
writeFragment<TData = unknown, TVariables = OperationVariables>(options: DataProxy.WriteFragmentOptions<TData, TVariables>): Reference | undefined;
|
|
154
139
|
}
|
|
155
140
|
//# sourceMappingURL=DataProxy.d.cts.map
|
|
@@ -81,7 +81,7 @@ class EntityStore {
|
|
|
81
81
|
// then there are no fields to be merged, so we're done.
|
|
82
82
|
if (!incoming)
|
|
83
83
|
return;
|
|
84
|
-
(0, invariant_1.invariant)(typeof dataId === "string",
|
|
84
|
+
(0, invariant_1.invariant)(typeof dataId === "string", 83);
|
|
85
85
|
const merged = new utilities_1.DeepMerger(storeObjectReconciler).merge(existing, incoming);
|
|
86
86
|
// Even if merged === existing, existing may have come from a lower
|
|
87
87
|
// layer, so we always need to set this.data[dataId] on this level.
|
|
@@ -181,7 +181,7 @@ class EntityStore {
|
|
|
181
181
|
if (environment_1.__DEV__) {
|
|
182
182
|
const checkReference = (ref) => {
|
|
183
183
|
if (this.lookup(ref.__ref) === undefined) {
|
|
184
|
-
__DEV__ && invariant_1.invariant.warn(
|
|
184
|
+
__DEV__ && invariant_1.invariant.warn(84, ref);
|
|
185
185
|
return true;
|
|
186
186
|
}
|
|
187
187
|
};
|
|
@@ -210,7 +210,7 @@ class EntityStore {
|
|
|
210
210
|
}
|
|
211
211
|
}
|
|
212
212
|
if (seenReference && someNonReference !== undefined) {
|
|
213
|
-
__DEV__ && invariant_1.invariant.warn(
|
|
213
|
+
__DEV__ && invariant_1.invariant.warn(85, someNonReference);
|
|
214
214
|
break;
|
|
215
215
|
}
|
|
216
216
|
}
|
|
@@ -631,13 +631,11 @@ class Layer extends EntityStore {
|
|
|
631
631
|
}
|
|
632
632
|
: fromParent;
|
|
633
633
|
}
|
|
634
|
-
getStorage() {
|
|
634
|
+
getStorage(...args) {
|
|
635
635
|
let p = this.parent;
|
|
636
636
|
while (p.parent)
|
|
637
637
|
p = p.parent;
|
|
638
|
-
return p.getStorage
|
|
639
|
-
// @ts-expect-error
|
|
640
|
-
arguments);
|
|
638
|
+
return p.getStorage(...args);
|
|
641
639
|
}
|
|
642
640
|
}
|
|
643
641
|
// Represents a Layer permanently installed just above the Root, which allows
|