@apollo/client 4.0.0-alpha.7 → 4.0.0-alpha.8
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/afraid-moons-arrive.md +5 -0
- package/.changeset/beige-mirrors-talk.md +15 -0
- package/.changeset/early-eggs-develop.md +22 -0
- package/.changeset/giant-apes-thank.md +5 -0
- package/.changeset/ninety-bags-bake.md +17 -0
- package/.changeset/perfect-vans-give.md +7 -0
- package/.changeset/pre.json +10 -0
- package/.changeset/shaggy-pugs-add.md +52 -0
- package/.changeset/short-months-complain.md +5 -0
- package/.changeset/swift-rivers-share.md +13 -0
- package/.changeset/wicked-forks-double.md +33 -0
- package/CHANGELOG.md +166 -0
- package/__cjs/cache/core/cache.cjs +1 -1
- package/__cjs/cache/core/cache.cjs.map +1 -1
- package/__cjs/cache/core/cache.d.cts +1 -1
- package/__cjs/cache/core/types/Cache.cjs.map +1 -1
- package/__cjs/cache/core/types/Cache.d.cts +1 -1
- package/__cjs/cache/core/types/DataProxy.d.cts +1 -1
- package/__cjs/cache/core/types/common.cjs +1 -0
- package/__cjs/cache/core/types/common.cjs.map +1 -1
- package/__cjs/cache/inmemory/entityStore.cjs +7 -4
- package/__cjs/cache/inmemory/entityStore.cjs.map +1 -1
- package/__cjs/cache/inmemory/entityStore.d.cts +1 -0
- package/__cjs/cache/inmemory/fragmentRegistry.cjs.map +1 -1
- package/__cjs/cache/inmemory/inMemoryCache.cjs.map +1 -1
- package/__cjs/cache/inmemory/inMemoryCache.d.cts +1 -1
- package/__cjs/cache/inmemory/key-extractor.cjs +1 -1
- package/__cjs/cache/inmemory/policies.cjs +4 -4
- package/__cjs/cache/inmemory/reactiveVars.cjs.map +1 -1
- package/__cjs/cache/inmemory/reactiveVars.d.cts +1 -1
- package/__cjs/cache/inmemory/readFromStore.cjs +2 -2
- package/__cjs/cache/inmemory/readFromStore.cjs.map +1 -1
- package/__cjs/cache/inmemory/types.d.cts +1 -1
- package/__cjs/cache/inmemory/writeToStore.cjs +4 -4
- package/__cjs/cache/inmemory/writeToStore.cjs.map +1 -1
- package/__cjs/cache/inmemory/writeToStore.d.cts +1 -1
- package/__cjs/config/jest/areCombinedGraphQLErrorsEqual.cjs +2 -3
- package/__cjs/config/jest/areCombinedGraphQLErrorsEqual.cjs.map +1 -1
- package/__cjs/config/jest/areCombinedProtocolErrorsEqual.cjs +2 -3
- package/__cjs/config/jest/areCombinedProtocolErrorsEqual.cjs.map +1 -1
- package/__cjs/config/jest/areMissingFieldErrorsEqual.cjs +2 -3
- package/__cjs/config/jest/areMissingFieldErrorsEqual.cjs.map +1 -1
- package/__cjs/config/jest/areServerErrorsEqual.cjs +21 -0
- package/__cjs/config/jest/areServerErrorsEqual.cjs.map +1 -0
- package/__cjs/config/jest/areServerErrorsEqual.d.cts +3 -0
- package/__cjs/config/jest/resolver.cjs +11 -0
- package/__cjs/config/jest/resolver.cjs.map +1 -1
- package/__cjs/config/jest/setup.cjs +12 -1
- package/__cjs/config/jest/setup.cjs.map +1 -1
- package/__cjs/core/ApolloClient.cjs +7 -7
- package/__cjs/core/LocalState.cjs +2 -2
- package/__cjs/core/ObservableQuery.cjs +105 -38
- package/__cjs/core/ObservableQuery.cjs.map +1 -1
- package/__cjs/core/ObservableQuery.d.cts +18 -1
- package/__cjs/core/QueryInfo.cjs +4 -71
- package/__cjs/core/QueryInfo.cjs.map +1 -1
- package/__cjs/core/QueryInfo.d.cts +0 -8
- package/__cjs/core/QueryManager.cjs +27 -48
- package/__cjs/core/QueryManager.cjs.map +1 -1
- package/__cjs/core/QueryManager.d.cts +3 -3
- package/__cjs/core/index.cjs +3 -1
- package/__cjs/core/index.cjs.map +1 -1
- package/__cjs/core/index.d.cts +1 -0
- package/__cjs/errors/CombinedGraphQLErrors.cjs.map +1 -1
- package/__cjs/errors/CombinedGraphQLErrors.d.cts +1 -1
- package/__cjs/errors/index.cjs +21 -2
- package/__cjs/errors/index.cjs.map +1 -1
- package/__cjs/errors/index.d.cts +2 -0
- package/__cjs/invariantErrorCodes.cjs +82 -70
- package/__cjs/link/context/index.cjs.map +1 -1
- package/__cjs/link/context/index.d.cts +1 -1
- package/__cjs/link/core/ApolloLink.cjs +2 -20
- package/__cjs/link/core/ApolloLink.cjs.map +1 -1
- package/__cjs/link/core/ApolloLink.d.cts +1 -3
- package/__cjs/link/core/types.d.cts +1 -1
- package/__cjs/link/error/index.cjs +13 -28
- package/__cjs/link/error/index.cjs.map +1 -1
- package/__cjs/link/error/index.d.cts +4 -15
- package/__cjs/link/http/checkFetcher.cjs +1 -1
- package/__cjs/link/http/createHttpLink.cjs +1 -1
- package/__cjs/link/http/parseAndCheckHttpResponse.cjs +1 -1
- package/__cjs/link/http/serializeFetchParameter.cjs +1 -1
- package/__cjs/link/persisted-queries/index.cjs +2 -2
- package/__cjs/link/persisted-queries/index.cjs.map +1 -1
- package/__cjs/link/remove-typename/removeTypenameFromVariables.cjs.map +1 -1
- package/__cjs/link/utils/validateOperation.cjs +1 -1
- package/__cjs/masking/maskDefinition.cjs +2 -2
- package/__cjs/masking/maskFragment.cjs +2 -2
- package/__cjs/masking/maskFragment.cjs.map +1 -1
- package/__cjs/masking/maskFragment.d.cts +1 -1
- package/__cjs/masking/maskOperation.cjs +1 -1
- package/__cjs/masking/maskOperation.cjs.map +1 -1
- package/__cjs/masking/maskOperation.d.cts +1 -1
- package/__cjs/masking/utils.cjs +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 +1 -1
- package/__cjs/react/hooks/internal/wrapHook.cjs.map +1 -1
- package/__cjs/react/hooks/internal/wrapHook.d.cts +2 -2
- 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.map +1 -1
- package/__cjs/react/hooks/useBackgroundQuery.d.cts +2 -2
- package/__cjs/react/hooks/useFragment.cjs.map +1 -1
- package/__cjs/react/hooks/useFragment.d.cts +1 -1
- package/__cjs/react/hooks/useLazyQuery.cjs +4 -4
- package/__cjs/react/hooks/useLazyQuery.cjs.map +1 -1
- package/__cjs/react/hooks/useLazyQuery.d.cts +2 -2
- package/__cjs/react/hooks/useLoadableQuery.cjs +2 -2
- package/__cjs/react/hooks/useLoadableQuery.cjs.map +1 -1
- package/__cjs/react/hooks/useLoadableQuery.d.cts +2 -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 +4 -4
- package/__cjs/react/hooks/useQuery.cjs.map +1 -1
- package/__cjs/react/hooks/useQuery.d.cts +2 -3
- package/__cjs/react/hooks/useQueryRefHandlers.cjs.map +1 -1
- package/__cjs/react/hooks/useQueryRefHandlers.d.cts +2 -2
- package/__cjs/react/hooks/useReactiveVar.cjs.map +1 -1
- package/__cjs/react/hooks/useReactiveVar.d.cts +1 -1
- package/__cjs/react/hooks/useReadQuery.cjs.map +1 -1
- package/__cjs/react/hooks/useReadQuery.d.cts +1 -1
- package/__cjs/react/hooks/useSubscription.cjs +1 -1
- package/__cjs/react/hooks/useSubscription.cjs.map +1 -1
- package/__cjs/react/hooks/useSubscription.d.cts +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 +4 -4
- package/__cjs/react/hooks/useSuspenseQuery.cjs.map +1 -1
- package/__cjs/react/hooks/useSuspenseQuery.d.cts +3 -3
- package/__cjs/react/hooks/useSyncExternalStore.cjs +1 -1
- package/__cjs/react/internal/cache/FragmentReference.cjs.map +1 -1
- package/__cjs/react/internal/cache/FragmentReference.d.cts +1 -1
- package/__cjs/react/internal/cache/QueryReference.cjs +1 -1
- package/__cjs/react/internal/cache/QueryReference.cjs.map +1 -1
- package/__cjs/react/internal/cache/QueryReference.d.cts +1 -1
- package/__cjs/react/internal/cache/SuspenseCache.cjs.map +1 -1
- package/__cjs/react/internal/cache/SuspenseCache.d.cts +1 -1
- package/__cjs/react/internal/cache/getSuspenseCache.cjs.map +1 -1
- package/__cjs/react/internal/cache/getSuspenseCache.d.cts +2 -2
- package/__cjs/react/internal/types.d.cts +1 -1
- package/__cjs/react/query-preloader/createQueryPreloader.cjs.map +1 -1
- package/__cjs/react/query-preloader/createQueryPreloader.d.cts +1 -1
- package/__cjs/react/ssr/prerenderStatic.cjs +2 -2
- package/__cjs/react/ssr/prerenderStatic.cjs.map +1 -1
- package/__cjs/react/ssr/prerenderStatic.d.cts +1 -1
- package/__cjs/react/ssr/useSSRQuery.cjs.map +1 -1
- package/__cjs/react/types/deprecated.d.cts +1 -1
- package/__cjs/testing/core/index.cjs +2 -1
- package/__cjs/testing/core/index.cjs.map +1 -1
- package/__cjs/testing/core/index.d.cts +2 -2
- package/__cjs/testing/core/mocking/mockClient.cjs +3 -4
- package/__cjs/testing/core/mocking/mockClient.cjs.map +1 -1
- package/__cjs/testing/core/mocking/mockClient.d.cts +1 -1
- package/__cjs/testing/core/mocking/mockLink.cjs +118 -112
- package/__cjs/testing/core/mocking/mockLink.cjs.map +1 -1
- package/__cjs/testing/core/mocking/mockLink.d.cts +26 -7
- package/__cjs/testing/experimental/createSchemaFetch.cjs +2 -2
- package/__cjs/testing/experimental/createSchemaFetch.cjs.map +1 -1
- package/__cjs/testing/experimental/createTestSchema.cjs.map +1 -1
- package/__cjs/testing/experimental/createTestSchema.d.cts +1 -1
- package/__cjs/testing/index.cjs +2 -1
- package/__cjs/testing/index.cjs.map +1 -1
- package/__cjs/testing/index.d.cts +1 -1
- package/__cjs/testing/internal/incremental.cjs.map +1 -1
- package/__cjs/testing/internal/incremental.d.cts +1 -1
- package/__cjs/testing/internal/renderHelpers.cjs.map +1 -1
- package/__cjs/testing/internal/renderHelpers.d.cts +1 -1
- package/__cjs/testing/internal/scenarios/index.cjs +9 -7
- package/__cjs/testing/internal/scenarios/index.cjs.map +1 -1
- package/__cjs/testing/internal/scenarios/index.d.cts +6 -8
- package/__cjs/testing/matchers/toHaveSuspenseCacheEntryUsing.cjs +2 -2
- package/__cjs/testing/matchers/toHaveSuspenseCacheEntryUsing.cjs.map +1 -1
- package/__cjs/testing/matchers/toHaveSuspenseCacheEntryUsing.d.cts +1 -1
- package/__cjs/testing/matchers/toMatchDocument.cjs.map +1 -1
- package/__cjs/testing/matchers/toMatchDocument.d.cts +1 -1
- package/__cjs/testing/matchers/utils/getSerializableProperties.cjs +2 -2
- package/__cjs/testing/matchers/utils/getSerializableProperties.cjs.map +1 -1
- package/__cjs/testing/react/MockedProvider.cjs +9 -5
- package/__cjs/testing/react/MockedProvider.cjs.map +1 -1
- package/__cjs/testing/react/MockedProvider.d.cts +5 -3
- package/__cjs/utilities/common/mergeOptions.cjs.map +1 -1
- package/__cjs/utilities/common/mergeOptions.d.cts +1 -1
- package/__cjs/utilities/graphql/operations.cjs.map +1 -1
- package/__cjs/utilities/graphql/operations.d.cts +1 -1
- package/__cjs/utilities/index.cjs.map +1 -1
- package/__cjs/utilities/index.d.cts +1 -1
- package/__cjs/utilities/internal/getMemoryInternals.cjs.map +1 -1
- package/__cjs/utilities/internal/toQueryResult.cjs.map +1 -1
- package/__cjs/utilities/internal/toQueryResult.d.cts +1 -1
- package/__cjs/utilities/subscriptions/relay/index.cjs +2 -2
- package/__cjs/utilities/subscriptions/relay/index.cjs.map +1 -1
- package/__cjs/utilities/subscriptions/relay/index.d.cts +1 -1
- package/__cjs/version.cjs +1 -1
- package/__cjs/version.cjs.map +1 -1
- package/__cjs/version.d.cts +1 -1
- package/cache/core/cache.d.ts +1 -1
- package/cache/core/cache.js +1 -1
- package/cache/core/cache.js.map +1 -1
- package/cache/core/types/Cache.d.ts +1 -1
- package/cache/core/types/Cache.js.map +1 -1
- package/cache/core/types/DataProxy.d.ts +1 -1
- package/cache/core/types/common.js +1 -0
- package/cache/core/types/common.js.map +1 -1
- package/cache/inmemory/entityStore.d.ts +1 -0
- package/cache/inmemory/entityStore.js +7 -4
- package/cache/inmemory/entityStore.js.map +1 -1
- package/cache/inmemory/fragmentRegistry.js +1 -1
- package/cache/inmemory/fragmentRegistry.js.map +1 -1
- package/cache/inmemory/inMemoryCache.d.ts +1 -1
- package/cache/inmemory/inMemoryCache.js.map +1 -1
- package/cache/inmemory/key-extractor.js +1 -1
- package/cache/inmemory/policies.js +4 -4
- package/cache/inmemory/reactiveVars.d.ts +1 -1
- package/cache/inmemory/reactiveVars.js.map +1 -1
- package/cache/inmemory/readFromStore.js +2 -2
- package/cache/inmemory/readFromStore.js.map +1 -1
- package/cache/inmemory/types.d.ts +1 -1
- package/cache/inmemory/writeToStore.d.ts +1 -1
- package/cache/inmemory/writeToStore.js +4 -4
- package/cache/inmemory/writeToStore.js.map +1 -1
- package/config/jest/areCombinedGraphQLErrorsEqual.js +2 -3
- package/config/jest/areCombinedGraphQLErrorsEqual.js.map +1 -1
- package/config/jest/areCombinedProtocolErrorsEqual.js +2 -3
- package/config/jest/areCombinedProtocolErrorsEqual.js.map +1 -1
- package/config/jest/areMissingFieldErrorsEqual.js +2 -3
- package/config/jest/areMissingFieldErrorsEqual.js.map +1 -1
- package/config/jest/areServerErrorsEqual.d.ts +3 -0
- package/config/jest/areServerErrorsEqual.js +17 -0
- package/config/jest/areServerErrorsEqual.js.map +1 -0
- package/config/jest/resolver.js +12 -1
- package/config/jest/resolver.js.map +1 -1
- package/config/jest/setup.js +13 -2
- package/config/jest/setup.js.map +1 -1
- package/core/ApolloClient.js +7 -7
- package/core/LocalState.js +2 -2
- package/core/ObservableQuery.d.ts +18 -1
- package/core/ObservableQuery.js +104 -36
- package/core/ObservableQuery.js.map +1 -1
- package/core/QueryInfo.d.ts +0 -8
- package/core/QueryInfo.js +4 -71
- package/core/QueryInfo.js.map +1 -1
- package/core/QueryManager.d.ts +3 -3
- package/core/QueryManager.js +28 -49
- package/core/QueryManager.js.map +1 -1
- package/core/index.d.ts +1 -0
- package/core/index.js +2 -1
- package/core/index.js.map +1 -1
- package/errors/CombinedGraphQLErrors.d.ts +1 -1
- package/errors/CombinedGraphQLErrors.js.map +1 -1
- package/errors/index.d.ts +2 -0
- package/errors/index.js +18 -0
- package/errors/index.js.map +1 -1
- package/invariantErrorCodes.js +82 -70
- package/link/context/index.d.ts +1 -1
- package/link/context/index.js.map +1 -1
- package/link/core/ApolloLink.d.ts +1 -3
- package/link/core/ApolloLink.js +2 -20
- package/link/core/ApolloLink.js.map +1 -1
- package/link/core/types.d.ts +1 -1
- package/link/error/index.d.ts +4 -15
- package/link/error/index.js +14 -29
- package/link/error/index.js.map +1 -1
- package/link/http/checkFetcher.js +1 -1
- package/link/http/createHttpLink.js +1 -1
- package/link/http/parseAndCheckHttpResponse.js +1 -1
- package/link/http/serializeFetchParameter.js +1 -1
- package/link/persisted-queries/index.js +3 -3
- package/link/persisted-queries/index.js.map +1 -1
- package/link/remove-typename/removeTypenameFromVariables.js.map +1 -1
- package/link/utils/validateOperation.js +1 -1
- package/masking/maskDefinition.js +2 -2
- package/masking/maskFragment.d.ts +1 -1
- package/masking/maskFragment.js +2 -2
- package/masking/maskFragment.js.map +1 -1
- package/masking/maskOperation.d.ts +1 -1
- package/masking/maskOperation.js +1 -1
- package/masking/maskOperation.js.map +1 -1
- package/masking/utils.js +1 -1
- package/package.json +10 -10
- 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 +1 -1
- package/react/context/ApolloProvider.js +1 -1
- package/react/context/ApolloProvider.js.map +1 -1
- package/react/hooks/internal/wrapHook.d.ts +2 -2
- 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.d.ts +2 -2
- package/react/hooks/useBackgroundQuery.js.map +1 -1
- package/react/hooks/useFragment.d.ts +1 -1
- package/react/hooks/useFragment.js.map +1 -1
- package/react/hooks/useLazyQuery.d.ts +2 -2
- package/react/hooks/useLazyQuery.js +3 -3
- package/react/hooks/useLazyQuery.js.map +1 -1
- package/react/hooks/useLoadableQuery.d.ts +2 -2
- package/react/hooks/useLoadableQuery.js +2 -2
- package/react/hooks/useLoadableQuery.js.map +1 -1
- package/react/hooks/useMutation.d.ts +1 -1
- package/react/hooks/useMutation.js.map +1 -1
- package/react/hooks/useQuery.d.ts +2 -3
- package/react/hooks/useQuery.js +2 -2
- package/react/hooks/useQuery.js.map +1 -1
- package/react/hooks/useQueryRefHandlers.d.ts +2 -2
- package/react/hooks/useQueryRefHandlers.js.map +1 -1
- package/react/hooks/useReactiveVar.d.ts +1 -1
- package/react/hooks/useReactiveVar.js.map +1 -1
- package/react/hooks/useReadQuery.d.ts +1 -1
- package/react/hooks/useReadQuery.js.map +1 -1
- package/react/hooks/useSubscription.d.ts +1 -1
- package/react/hooks/useSubscription.js +1 -1
- package/react/hooks/useSubscription.js.map +1 -1
- package/react/hooks/useSuspenseFragment.d.ts +1 -1
- package/react/hooks/useSuspenseFragment.js.map +1 -1
- package/react/hooks/useSuspenseQuery.d.ts +3 -3
- package/react/hooks/useSuspenseQuery.js +3 -3
- package/react/hooks/useSuspenseQuery.js.map +1 -1
- package/react/hooks/useSyncExternalStore.js +1 -1
- package/react/internal/cache/FragmentReference.d.ts +1 -1
- 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 -1
- package/react/internal/cache/QueryReference.js.map +1 -1
- package/react/internal/cache/SuspenseCache.d.ts +1 -1
- package/react/internal/cache/SuspenseCache.js.map +1 -1
- package/react/internal/cache/getSuspenseCache.d.ts +2 -2
- package/react/internal/cache/getSuspenseCache.js.map +1 -1
- package/react/internal/types.d.ts +1 -1
- package/react/query-preloader/createQueryPreloader.d.ts +1 -1
- package/react/query-preloader/createQueryPreloader.js.map +1 -1
- package/react/ssr/prerenderStatic.d.ts +1 -1
- package/react/ssr/prerenderStatic.js +2 -2
- package/react/ssr/prerenderStatic.js.map +1 -1
- package/react/ssr/useSSRQuery.js.map +1 -1
- package/react/types/deprecated.d.ts +1 -1
- package/testing/core/index.d.ts +2 -2
- package/testing/core/index.js +1 -1
- package/testing/core/index.js.map +1 -1
- package/testing/core/mocking/mockClient.d.ts +1 -1
- package/testing/core/mocking/mockClient.js +2 -3
- package/testing/core/mocking/mockClient.js.map +1 -1
- package/testing/core/mocking/mockLink.d.ts +26 -7
- package/testing/core/mocking/mockLink.js +117 -113
- package/testing/core/mocking/mockLink.js.map +1 -1
- package/testing/experimental/createSchemaFetch.js +1 -1
- package/testing/experimental/createSchemaFetch.js.map +1 -1
- package/testing/experimental/createTestSchema.d.ts +1 -1
- package/testing/experimental/createTestSchema.js.map +1 -1
- package/testing/index.d.ts +1 -1
- package/testing/index.js +1 -1
- package/testing/index.js.map +1 -1
- package/testing/internal/incremental.d.ts +1 -1
- package/testing/internal/incremental.js.map +1 -1
- package/testing/internal/renderHelpers.d.ts +1 -1
- package/testing/internal/renderHelpers.js.map +1 -1
- package/testing/internal/scenarios/index.d.ts +6 -8
- package/testing/internal/scenarios/index.js +4 -2
- package/testing/internal/scenarios/index.js.map +1 -1
- package/testing/matchers/toHaveSuspenseCacheEntryUsing.d.ts +1 -1
- package/testing/matchers/toHaveSuspenseCacheEntryUsing.js +1 -1
- package/testing/matchers/toHaveSuspenseCacheEntryUsing.js.map +1 -1
- package/testing/matchers/toMatchDocument.d.ts +1 -1
- package/testing/matchers/toMatchDocument.js.map +1 -1
- package/testing/matchers/utils/getSerializableProperties.js +1 -1
- package/testing/matchers/utils/getSerializableProperties.js.map +1 -1
- package/testing/react/MockedProvider.d.ts +5 -3
- package/testing/react/MockedProvider.js +7 -3
- package/testing/react/MockedProvider.js.map +1 -1
- package/utilities/common/mergeOptions.d.ts +1 -1
- package/utilities/common/mergeOptions.js.map +1 -1
- package/utilities/graphql/operations.d.ts +1 -1
- package/utilities/graphql/operations.js.map +1 -1
- package/utilities/index.d.ts +1 -1
- package/utilities/index.js.map +1 -1
- package/utilities/internal/getMemoryInternals.js.map +1 -1
- package/utilities/internal/toQueryResult.d.ts +1 -1
- package/utilities/internal/toQueryResult.js.map +1 -1
- package/utilities/subscriptions/relay/index.d.ts +1 -1
- package/utilities/subscriptions/relay/index.js +1 -1
- package/utilities/subscriptions/relay/index.js.map +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.js.map +1 -1
- package/__cjs/index.cjs +0 -9
- package/__cjs/index.cjs.map +0 -1
- package/__cjs/index.d.cts +0 -3
- package/index.d.ts +0 -3
- package/index.js +0 -4
- package/index.js.map +0 -1
|
@@ -96,16 +96,16 @@ class QueryManager {
|
|
|
96
96
|
this.queries.forEach((_info, queryId) => {
|
|
97
97
|
this.removeQuery(queryId);
|
|
98
98
|
});
|
|
99
|
-
this.cancelPendingFetches((0, invariant_1.newInvariantError)(
|
|
99
|
+
this.cancelPendingFetches((0, invariant_1.newInvariantError)(72));
|
|
100
100
|
}
|
|
101
101
|
cancelPendingFetches(error) {
|
|
102
102
|
this.fetchCancelFns.forEach((cancel) => cancel(error));
|
|
103
103
|
this.fetchCancelFns.clear();
|
|
104
104
|
}
|
|
105
105
|
async mutate({ mutation, variables, optimisticResponse, updateQueries, refetchQueries = [], awaitRefetchQueries = false, update: updateWithProxyFn, onQueryUpdated, fetchPolicy = this.defaultOptions.mutate?.fetchPolicy || "network-only", errorPolicy = this.defaultOptions.mutate?.errorPolicy || "none", keepRootFields, context, }) {
|
|
106
|
-
(0, invariant_1.invariant)(mutation,
|
|
106
|
+
(0, invariant_1.invariant)(mutation, 73);
|
|
107
107
|
(0, utilities_1.checkDocument)(mutation, graphql_1.OperationTypeNode.MUTATION);
|
|
108
|
-
(0, invariant_1.invariant)(fetchPolicy === "network-only" || fetchPolicy === "no-cache",
|
|
108
|
+
(0, invariant_1.invariant)(fetchPolicy === "network-only" || fetchPolicy === "no-cache", 74);
|
|
109
109
|
const mutationId = this.generateMutationId();
|
|
110
110
|
mutation = this.cache.transformForLink(this.transform(mutation));
|
|
111
111
|
const { hasClientExports } = this.getDocumentInfo(mutation);
|
|
@@ -198,7 +198,7 @@ class QueryManager {
|
|
|
198
198
|
}
|
|
199
199
|
},
|
|
200
200
|
error: (err) => {
|
|
201
|
-
const error =
|
|
201
|
+
const error = (0, errors_1.toErrorLike)(err);
|
|
202
202
|
if (mutationStoreValue) {
|
|
203
203
|
mutationStoreValue.loading = false;
|
|
204
204
|
mutationStoreValue.error = error;
|
|
@@ -403,7 +403,7 @@ class QueryManager {
|
|
|
403
403
|
return true;
|
|
404
404
|
}
|
|
405
405
|
fetchQuery(queryId, options, networkStatus) {
|
|
406
|
-
return (0, rxjs_1.lastValueFrom)(this.fetchObservableWithInfo(queryId, options, networkStatus).observable.pipe((0, rxjs_1.map)(internal_1.toQueryResult)), {
|
|
406
|
+
return (0, rxjs_1.lastValueFrom)(this.fetchObservableWithInfo(this.getOrCreateQuery(queryId), options, networkStatus).observable.pipe((0, rxjs_1.map)(internal_1.toQueryResult)), {
|
|
407
407
|
// This default is needed when a `standby` fetch policy is used to avoid
|
|
408
408
|
// an EmptyError from rejecting this promise.
|
|
409
409
|
defaultValue: { data: undefined },
|
|
@@ -478,7 +478,9 @@ class QueryManager {
|
|
|
478
478
|
options,
|
|
479
479
|
});
|
|
480
480
|
observable["lastQuery"] = query;
|
|
481
|
-
|
|
481
|
+
if (!ObservableQuery_js_1.ObservableQuery["inactiveOnCreation"].getValue()) {
|
|
482
|
+
this.queries.set(observable.queryId, queryInfo);
|
|
483
|
+
}
|
|
482
484
|
// We give queryInfo the transformed query to ensure the first cache diff
|
|
483
485
|
// uses the transformed query instead of the raw query
|
|
484
486
|
queryInfo.init({ document: query, variables: observable.variables });
|
|
@@ -520,7 +522,7 @@ class QueryManager {
|
|
|
520
522
|
// depend on values that previously existed in the data portion of the
|
|
521
523
|
// store. So, we cancel the promises and observers that we have issued
|
|
522
524
|
// so far and not yet resolved (in the case of queries).
|
|
523
|
-
this.cancelPendingFetches((0, invariant_1.newInvariantError)(
|
|
525
|
+
this.cancelPendingFetches((0, invariant_1.newInvariantError)(75));
|
|
524
526
|
this.queries.forEach((queryInfo) => {
|
|
525
527
|
if (queryInfo.observableQuery) {
|
|
526
528
|
// Set loading to true so listeners don't trigger unless they want
|
|
@@ -586,7 +588,7 @@ class QueryManager {
|
|
|
586
588
|
// pre-allocate a new query ID here, using a special prefix to enable
|
|
587
589
|
// cleaning up these temporary queries later, after fetching.
|
|
588
590
|
const queryId = (0, utilities_4.makeUniqueId)("legacyOneTimeQuery");
|
|
589
|
-
const queryInfo = this.
|
|
591
|
+
const queryInfo = this.getOrCreateQuery(queryId).init({
|
|
590
592
|
document: options.query,
|
|
591
593
|
variables: options.variables,
|
|
592
594
|
});
|
|
@@ -608,10 +610,10 @@ class QueryManager {
|
|
|
608
610
|
if (!included) {
|
|
609
611
|
const queryName = queryNames.get(nameOrQueryString);
|
|
610
612
|
if (queryName) {
|
|
611
|
-
__DEV__ && invariant_1.invariant.warn(
|
|
613
|
+
__DEV__ && invariant_1.invariant.warn(76, queryName);
|
|
612
614
|
}
|
|
613
615
|
else {
|
|
614
|
-
__DEV__ && invariant_1.invariant.warn(
|
|
616
|
+
__DEV__ && invariant_1.invariant.warn(77);
|
|
615
617
|
}
|
|
616
618
|
}
|
|
617
619
|
});
|
|
@@ -627,14 +629,11 @@ class QueryManager {
|
|
|
627
629
|
(fetchPolicy !== "standby" && fetchPolicy !== "cache-only")) {
|
|
628
630
|
observableQueryPromises.push(observableQuery.refetch());
|
|
629
631
|
}
|
|
630
|
-
this.
|
|
632
|
+
(this.queries.get(queryId) || observableQuery["queryInfo"]).setDiff(null);
|
|
631
633
|
});
|
|
632
634
|
this.broadcastQueries();
|
|
633
635
|
return Promise.all(observableQueryPromises);
|
|
634
636
|
}
|
|
635
|
-
setObservableQuery(observableQuery) {
|
|
636
|
-
this.getQuery(observableQuery.queryId).setObservableQuery(observableQuery);
|
|
637
|
-
}
|
|
638
637
|
startGraphQLSubscription(options) {
|
|
639
638
|
let { query, variables } = options;
|
|
640
639
|
const { fetchPolicy, errorPolicy = "none", context = {}, extensions = {}, } = options;
|
|
@@ -681,7 +680,7 @@ class QueryManager {
|
|
|
681
680
|
if (errorPolicy === "ignore") {
|
|
682
681
|
return (0, rxjs_1.of)({ data: undefined });
|
|
683
682
|
}
|
|
684
|
-
return (0, rxjs_1.of)({ data: undefined, error:
|
|
683
|
+
return (0, rxjs_1.of)({ data: undefined, error: (0, errors_1.toErrorLike)(error) });
|
|
685
684
|
}), (0, rxjs_1.filter)((result) => !!(result.data || result.error)));
|
|
686
685
|
if (this.getDocumentInfo(query).hasClientExports) {
|
|
687
686
|
const observablePromise = this.localState
|
|
@@ -707,14 +706,14 @@ class QueryManager {
|
|
|
707
706
|
// The same queryId could have two rejection fns for two promises
|
|
708
707
|
this.fetchCancelFns.delete(queryId);
|
|
709
708
|
if (this.queries.has(queryId)) {
|
|
710
|
-
this.
|
|
709
|
+
this.queries.get(queryId)?.stop();
|
|
711
710
|
this.queries.delete(queryId);
|
|
712
711
|
}
|
|
713
712
|
}
|
|
714
713
|
broadcastQueries() {
|
|
715
714
|
if (this.onBroadcast)
|
|
716
715
|
this.onBroadcast();
|
|
717
|
-
this.queries.forEach((info) => info.notify());
|
|
716
|
+
this.queries.forEach((info) => info.observableQuery?.["notify"]());
|
|
718
717
|
}
|
|
719
718
|
getLocalState() {
|
|
720
719
|
return this.localState;
|
|
@@ -793,7 +792,7 @@ class QueryManager {
|
|
|
793
792
|
if (requestId >= queryInfo.lastRequestId) {
|
|
794
793
|
if (hasErrors && errorPolicy === "none") {
|
|
795
794
|
queryInfo.resetLastWrite();
|
|
796
|
-
queryInfo.
|
|
795
|
+
queryInfo.observableQuery?.["resetNotifications"]();
|
|
797
796
|
// Throwing here effectively calls observer.error.
|
|
798
797
|
throw new errors_1.CombinedGraphQLErrors(result);
|
|
799
798
|
}
|
|
@@ -821,11 +820,11 @@ class QueryManager {
|
|
|
821
820
|
}
|
|
822
821
|
return aqr;
|
|
823
822
|
}), (0, rxjs_1.catchError)((error) => {
|
|
824
|
-
error =
|
|
823
|
+
error = (0, errors_1.toErrorLike)(error);
|
|
825
824
|
// Avoid storing errors from older interrupted queries.
|
|
826
825
|
if (requestId >= queryInfo.lastRequestId && errorPolicy === "none") {
|
|
827
826
|
queryInfo.resetLastWrite();
|
|
828
|
-
queryInfo.
|
|
827
|
+
queryInfo.observableQuery?.["resetNotifications"]();
|
|
829
828
|
throw error;
|
|
830
829
|
}
|
|
831
830
|
const aqr = {
|
|
@@ -841,13 +840,12 @@ class QueryManager {
|
|
|
841
840
|
return (0, rxjs_1.of)(aqr);
|
|
842
841
|
}));
|
|
843
842
|
}
|
|
844
|
-
fetchObservableWithInfo(
|
|
843
|
+
fetchObservableWithInfo(queryInfo, options,
|
|
845
844
|
// The initial networkStatus for this fetch, most often
|
|
846
845
|
// NetworkStatus.loading, but also possibly fetchMore, poll, refetch,
|
|
847
846
|
// or setVariables.
|
|
848
847
|
networkStatus = networkStatus_js_1.NetworkStatus.loading, query = options.query, emitLoadingState = false) {
|
|
849
848
|
const variables = this.getVariables(query, options.variables);
|
|
850
|
-
const queryInfo = this.getQuery(queryId);
|
|
851
849
|
const defaults = this.defaultOptions.watchQuery;
|
|
852
850
|
let { fetchPolicy = (defaults && defaults.fetchPolicy) || "cache-first", errorPolicy = (defaults && defaults.errorPolicy) || "none", returnPartialData = false, notifyOnNetworkStatusChange = false, context = {}, } = options;
|
|
853
851
|
if (this.prioritizeCacheValues &&
|
|
@@ -881,13 +879,13 @@ class QueryManager {
|
|
|
881
879
|
// This cancel function needs to be set before the concast is created,
|
|
882
880
|
// in case concast creation synchronously cancels the request.
|
|
883
881
|
const cleanupCancelFn = () => {
|
|
884
|
-
this.fetchCancelFns.delete(queryId);
|
|
882
|
+
this.fetchCancelFns.delete(queryInfo.queryId);
|
|
885
883
|
// We need to call `complete` on the subject here otherwise the merged
|
|
886
884
|
// observable will never complete since it waits for all source
|
|
887
885
|
// observables to complete before itself completes.
|
|
888
886
|
fetchCancelSubject.complete();
|
|
889
887
|
};
|
|
890
|
-
this.fetchCancelFns.set(queryId, (reason) => {
|
|
888
|
+
this.fetchCancelFns.set(queryInfo.queryId, (reason) => {
|
|
891
889
|
fetchCancelSubject.error(reason);
|
|
892
890
|
cleanupCancelFn();
|
|
893
891
|
});
|
|
@@ -925,7 +923,7 @@ class QueryManager {
|
|
|
925
923
|
this.getObservableQueries(include).forEach((oq, queryId) => {
|
|
926
924
|
includedQueriesById.set(queryId, {
|
|
927
925
|
oq,
|
|
928
|
-
lastDiff: this.
|
|
926
|
+
lastDiff: (this.queries.get(queryId) || oq["queryInfo"]).getDiff(),
|
|
929
927
|
});
|
|
930
928
|
});
|
|
931
929
|
}
|
|
@@ -1011,9 +1009,7 @@ class QueryManager {
|
|
|
1011
1009
|
// queries, even the QueryOptions ones.
|
|
1012
1010
|
if (onQueryUpdated) {
|
|
1013
1011
|
if (!diff) {
|
|
1014
|
-
|
|
1015
|
-
info.reset(); // Force info.getDiff() to read from cache.
|
|
1016
|
-
diff = info.getDiff();
|
|
1012
|
+
diff = this.cache.diff(oq["queryInfo"]["getDiffOptions"]());
|
|
1017
1013
|
}
|
|
1018
1014
|
result = onQueryUpdated(oq, diff, lastDiff);
|
|
1019
1015
|
}
|
|
@@ -1053,7 +1049,7 @@ class QueryManager {
|
|
|
1053
1049
|
!(0, utilities_3.isFullyUnmaskedOperation)(document) &&
|
|
1054
1050
|
!this.noCacheWarningsByQueryId.has(operationId)) {
|
|
1055
1051
|
this.noCacheWarningsByQueryId.add(operationId);
|
|
1056
|
-
__DEV__ && invariant_1.invariant.warn(
|
|
1052
|
+
__DEV__ && invariant_1.invariant.warn(78, (0, utilities_4.getOperationName)(document) ??
|
|
1057
1053
|
`Unnamed ${operationType ?? "operation"}`);
|
|
1058
1054
|
}
|
|
1059
1055
|
}
|
|
@@ -1200,7 +1196,7 @@ class QueryManager {
|
|
|
1200
1196
|
return { fromLink: false, observable: rxjs_1.EMPTY };
|
|
1201
1197
|
}
|
|
1202
1198
|
}
|
|
1203
|
-
|
|
1199
|
+
getOrCreateQuery(queryId) {
|
|
1204
1200
|
if (queryId && !this.queries.has(queryId)) {
|
|
1205
1201
|
this.queries.set(queryId, new QueryInfo_js_1.QueryInfo(this, queryId));
|
|
1206
1202
|
}
|
|
@@ -1216,23 +1212,6 @@ class QueryManager {
|
|
|
1216
1212
|
}
|
|
1217
1213
|
}
|
|
1218
1214
|
exports.QueryManager = QueryManager;
|
|
1219
|
-
function isErrorLike(error) {
|
|
1220
|
-
return (error !== null &&
|
|
1221
|
-
typeof error === "object" &&
|
|
1222
|
-
typeof error.message === "string" &&
|
|
1223
|
-
typeof error.name === "string" &&
|
|
1224
|
-
(typeof error.stack === "undefined" ||
|
|
1225
|
-
typeof error.stack === "string"));
|
|
1226
|
-
}
|
|
1227
|
-
function maybeWrapError(error) {
|
|
1228
|
-
if (isErrorLike(error)) {
|
|
1229
|
-
return error;
|
|
1230
|
-
}
|
|
1231
|
-
if (typeof error === "string") {
|
|
1232
|
-
return new Error(error, { cause: error });
|
|
1233
|
-
}
|
|
1234
|
-
return new errors_1.UnconventionalError(error);
|
|
1235
|
-
}
|
|
1236
1215
|
function validateDidEmitValue() {
|
|
1237
1216
|
let didEmitValue = false;
|
|
1238
1217
|
return (0, rxjs_1.tap)({
|
|
@@ -1240,7 +1219,7 @@ function validateDidEmitValue() {
|
|
|
1240
1219
|
didEmitValue = true;
|
|
1241
1220
|
},
|
|
1242
1221
|
complete() {
|
|
1243
|
-
(0, invariant_1.invariant)(didEmitValue,
|
|
1222
|
+
(0, invariant_1.invariant)(didEmitValue, 79);
|
|
1244
1223
|
},
|
|
1245
1224
|
});
|
|
1246
1225
|
}
|