@depup/apollo__client 4.1.6-depup.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 +9911 -0
- package/LICENSE +22 -0
- package/README.md +35 -0
- package/__cjs/cache/core/cache.cjs +362 -0
- package/__cjs/cache/core/cache.cjs.map +1 -0
- package/__cjs/cache/core/cache.d.cts +291 -0
- package/__cjs/cache/core/types/Cache.cjs +3 -0
- package/__cjs/cache/core/types/Cache.cjs.map +1 -0
- package/__cjs/cache/core/types/Cache.d.cts +302 -0
- package/__cjs/cache/core/types/common.cjs +33 -0
- package/__cjs/cache/core/types/common.cjs.map +1 -0
- package/__cjs/cache/core/types/common.d.cts +64 -0
- package/__cjs/cache/deprecated.cjs +3 -0
- package/__cjs/cache/deprecated.cjs.map +1 -0
- package/__cjs/cache/deprecated.d.cts +6 -0
- package/__cjs/cache/index.cjs +25 -0
- package/__cjs/cache/index.cjs.map +1 -0
- package/__cjs/cache/index.d.cts +19 -0
- package/__cjs/cache/inmemory/entityStore.cjs +679 -0
- package/__cjs/cache/inmemory/entityStore.cjs.map +1 -0
- package/__cjs/cache/inmemory/entityStore.d.cts +94 -0
- package/__cjs/cache/inmemory/fragmentRegistry.cjs +134 -0
- package/__cjs/cache/inmemory/fragmentRegistry.cjs.map +1 -0
- package/__cjs/cache/inmemory/fragmentRegistry.d.cts +9 -0
- package/__cjs/cache/inmemory/helpers.cjs +93 -0
- package/__cjs/cache/inmemory/helpers.cjs.map +1 -0
- package/__cjs/cache/inmemory/helpers.d.cts +21 -0
- package/__cjs/cache/inmemory/inMemoryCache.cjs +514 -0
- package/__cjs/cache/inmemory/inMemoryCache.cjs.map +1 -0
- package/__cjs/cache/inmemory/inMemoryCache.d.cts +114 -0
- package/__cjs/cache/inmemory/key-extractor.cjs +192 -0
- package/__cjs/cache/inmemory/key-extractor.cjs.map +1 -0
- package/__cjs/cache/inmemory/key-extractor.d.cts +9 -0
- package/__cjs/cache/inmemory/policies.cjs +674 -0
- package/__cjs/cache/inmemory/policies.cjs.map +1 -0
- package/__cjs/cache/inmemory/policies.d.cts +126 -0
- package/__cjs/cache/inmemory/reactiveVars.cjs +89 -0
- package/__cjs/cache/inmemory/reactiveVars.cjs.map +1 -0
- package/__cjs/cache/inmemory/reactiveVars.d.cts +19 -0
- package/__cjs/cache/inmemory/readFromStore.cjs +293 -0
- package/__cjs/cache/inmemory/readFromStore.cjs.map +1 -0
- package/__cjs/cache/inmemory/readFromStore.d.cts +26 -0
- package/__cjs/cache/inmemory/types.cjs +3 -0
- package/__cjs/cache/inmemory/types.cjs.map +1 -0
- package/__cjs/cache/inmemory/types.d.cts +109 -0
- package/__cjs/cache/inmemory/writeToStore.cjs +594 -0
- package/__cjs/cache/inmemory/writeToStore.cjs.map +1 -0
- package/__cjs/cache/inmemory/writeToStore.d.cts +38 -0
- package/__cjs/core/ApolloClient.cjs +539 -0
- package/__cjs/core/ApolloClient.cjs.map +1 -0
- package/__cjs/core/ApolloClient.d.cts +1210 -0
- package/__cjs/core/ObservableQuery.cjs +1413 -0
- package/__cjs/core/ObservableQuery.cjs.map +1 -0
- package/__cjs/core/ObservableQuery.d.cts +467 -0
- package/__cjs/core/QueryInfo.cjs +401 -0
- package/__cjs/core/QueryInfo.cjs.map +1 -0
- package/__cjs/core/QueryInfo.d.cts +70 -0
- package/__cjs/core/QueryManager.cjs +1170 -0
- package/__cjs/core/QueryManager.cjs.map +1 -0
- package/__cjs/core/QueryManager.d.cts +168 -0
- package/__cjs/core/deprecated.cjs +3 -0
- package/__cjs/core/deprecated.cjs.map +1 -0
- package/__cjs/core/deprecated.d.cts +29 -0
- package/__cjs/core/index.cjs +79 -0
- package/__cjs/core/index.cjs.map +1 -0
- package/__cjs/core/index.d.cts +31 -0
- package/__cjs/core/networkStatus.cjs +51 -0
- package/__cjs/core/networkStatus.cjs.map +1 -0
- package/__cjs/core/networkStatus.d.cts +47 -0
- package/__cjs/core/types.cjs +3 -0
- package/__cjs/core/types.cjs.map +1 -0
- package/__cjs/core/types.d.cts +327 -0
- package/__cjs/core/watchQueryOptions.cjs +3 -0
- package/__cjs/core/watchQueryOptions.cjs.map +1 -0
- package/__cjs/core/watchQueryOptions.d.cts +75 -0
- package/__cjs/dev/index.cjs +12 -0
- package/__cjs/dev/index.cjs.map +1 -0
- package/__cjs/dev/index.d.cts +6 -0
- package/__cjs/dev/loadDevMessages.cjs +9 -0
- package/__cjs/dev/loadDevMessages.cjs.map +1 -0
- package/__cjs/dev/loadDevMessages.d.cts +2 -0
- package/__cjs/dev/loadErrorMessageHandler.cjs +27 -0
- package/__cjs/dev/loadErrorMessageHandler.cjs.map +1 -0
- package/__cjs/dev/loadErrorMessageHandler.d.cts +8 -0
- package/__cjs/dev/loadErrorMessages.cjs +9 -0
- package/__cjs/dev/loadErrorMessages.cjs.map +1 -0
- package/__cjs/dev/loadErrorMessages.d.cts +2 -0
- package/__cjs/dev/setErrorMessageHandler.cjs +12 -0
- package/__cjs/dev/setErrorMessageHandler.cjs.map +1 -0
- package/__cjs/dev/setErrorMessageHandler.d.cts +34 -0
- package/__cjs/dev/symbol.cjs +7 -0
- package/__cjs/dev/symbol.cjs.map +1 -0
- package/__cjs/dev/symbol.d.cts +10 -0
- package/__cjs/errors/CombinedGraphQLErrors.cjs +105 -0
- package/__cjs/errors/CombinedGraphQLErrors.cjs.map +1 -0
- package/__cjs/errors/CombinedGraphQLErrors.d.cts +191 -0
- package/__cjs/errors/CombinedProtocolErrors.cjs +84 -0
- package/__cjs/errors/CombinedProtocolErrors.cjs.map +1 -0
- package/__cjs/errors/CombinedProtocolErrors.d.cts +150 -0
- package/__cjs/errors/LinkError.cjs +67 -0
- package/__cjs/errors/LinkError.cjs.map +1 -0
- package/__cjs/errors/LinkError.d.cts +61 -0
- package/__cjs/errors/LocalStateError.cjs +57 -0
- package/__cjs/errors/LocalStateError.cjs.map +1 -0
- package/__cjs/errors/LocalStateError.d.cts +56 -0
- package/__cjs/errors/ServerError.cjs +79 -0
- package/__cjs/errors/ServerError.cjs.map +1 -0
- package/__cjs/errors/ServerError.d.cts +87 -0
- package/__cjs/errors/ServerParseError.cjs +76 -0
- package/__cjs/errors/ServerParseError.cjs.map +1 -0
- package/__cjs/errors/ServerParseError.d.cts +82 -0
- package/__cjs/errors/UnconventionalError.cjs +67 -0
- package/__cjs/errors/UnconventionalError.cjs.map +1 -0
- package/__cjs/errors/UnconventionalError.d.cts +55 -0
- package/__cjs/errors/index.cjs +45 -0
- package/__cjs/errors/index.cjs.map +1 -0
- package/__cjs/errors/index.d.cts +14 -0
- package/__cjs/errors/isErrorLike.cjs +12 -0
- package/__cjs/errors/isErrorLike.cjs.map +1 -0
- package/__cjs/errors/isErrorLike.d.cts +3 -0
- package/__cjs/errors/utils.cjs +18 -0
- package/__cjs/errors/utils.cjs.map +1 -0
- package/__cjs/errors/utils.d.cts +3 -0
- package/__cjs/incremental/handlers/defer20220824.cjs +127 -0
- package/__cjs/incremental/handlers/defer20220824.cjs.map +1 -0
- package/__cjs/incremental/handlers/defer20220824.d.cts +66 -0
- package/__cjs/incremental/handlers/graphql17Alpha9.cjs +227 -0
- package/__cjs/incremental/handlers/graphql17Alpha9.cjs.map +1 -0
- package/__cjs/incremental/handlers/graphql17Alpha9.d.cts +98 -0
- package/__cjs/incremental/handlers/notImplemented.cjs +19 -0
- package/__cjs/incremental/handlers/notImplemented.cjs.map +1 -0
- package/__cjs/incremental/handlers/notImplemented.d.cts +20 -0
- package/__cjs/incremental/index.cjs +11 -0
- package/__cjs/incremental/index.cjs.map +1 -0
- package/__cjs/incremental/index.d.cts +5 -0
- package/__cjs/incremental/types.cjs +3 -0
- package/__cjs/incremental/types.cjs.map +1 -0
- package/__cjs/incremental/types.d.cts +33 -0
- package/__cjs/invariantErrorCodes.cjs +731 -0
- package/__cjs/invariantErrorCodes.cjs.map +1 -0
- package/__cjs/invariantErrorCodes.d.cts +13 -0
- package/__cjs/link/batch/batchLink.cjs +53 -0
- package/__cjs/link/batch/batchLink.cjs.map +1 -0
- package/__cjs/link/batch/batchLink.d.cts +117 -0
- package/__cjs/link/batch/batching.cjs +156 -0
- package/__cjs/link/batch/batching.cjs.map +1 -0
- package/__cjs/link/batch/batching.d.cts +27 -0
- package/__cjs/link/batch/index.cjs +6 -0
- package/__cjs/link/batch/index.cjs.map +1 -0
- package/__cjs/link/batch/index.d.cts +2 -0
- package/__cjs/link/batch-http/BaseBatchHttpLink.cjs +156 -0
- package/__cjs/link/batch-http/BaseBatchHttpLink.cjs.map +1 -0
- package/__cjs/link/batch-http/BaseBatchHttpLink.d.cts +68 -0
- package/__cjs/link/batch-http/batchHttpLink.cjs +42 -0
- package/__cjs/link/batch-http/batchHttpLink.cjs.map +1 -0
- package/__cjs/link/batch-http/batchHttpLink.d.cts +49 -0
- package/__cjs/link/batch-http/index.cjs +8 -0
- package/__cjs/link/batch-http/index.cjs.map +1 -0
- package/__cjs/link/batch-http/index.d.cts +3 -0
- package/__cjs/link/client-awareness/ClientAwarenessLink.cjs +90 -0
- package/__cjs/link/client-awareness/ClientAwarenessLink.cjs.map +1 -0
- package/__cjs/link/client-awareness/ClientAwarenessLink.d.cts +114 -0
- package/__cjs/link/client-awareness/index.cjs +6 -0
- package/__cjs/link/client-awareness/index.cjs.map +1 -0
- package/__cjs/link/client-awareness/index.d.cts +2 -0
- package/__cjs/link/context/index.cjs +68 -0
- package/__cjs/link/context/index.cjs.map +1 -0
- package/__cjs/link/context/index.d.cts +85 -0
- package/__cjs/link/core/ApolloLink.cjs +274 -0
- package/__cjs/link/core/ApolloLink.cjs.map +1 -0
- package/__cjs/link/core/ApolloLink.d.cts +384 -0
- package/__cjs/link/core/concat.cjs +10 -0
- package/__cjs/link/core/concat.cjs.map +1 -0
- package/__cjs/link/core/concat.d.cts +7 -0
- package/__cjs/link/core/deprecated.cjs +3 -0
- package/__cjs/link/core/deprecated.cjs.map +1 -0
- package/__cjs/link/core/deprecated.d.cts +10 -0
- package/__cjs/link/core/empty.cjs +10 -0
- package/__cjs/link/core/empty.cjs.map +1 -0
- package/__cjs/link/core/empty.d.cts +7 -0
- package/__cjs/link/core/execute.cjs +6 -0
- package/__cjs/link/core/execute.cjs.map +1 -0
- package/__cjs/link/core/execute.d.cts +3 -0
- package/__cjs/link/core/from.cjs +10 -0
- package/__cjs/link/core/from.cjs.map +1 -0
- package/__cjs/link/core/from.d.cts +7 -0
- package/__cjs/link/core/split.cjs +10 -0
- package/__cjs/link/core/split.cjs.map +1 -0
- package/__cjs/link/core/split.d.cts +7 -0
- package/__cjs/link/core/types.cjs +3 -0
- package/__cjs/link/core/types.cjs.map +1 -0
- package/__cjs/link/core/types.d.cts +6 -0
- package/__cjs/link/error/index.cjs +129 -0
- package/__cjs/link/error/index.cjs.map +1 -0
- package/__cjs/link/error/index.d.cts +105 -0
- package/__cjs/link/http/BaseHttpLink.cjs +161 -0
- package/__cjs/link/http/BaseHttpLink.cjs.map +1 -0
- package/__cjs/link/http/BaseHttpLink.d.cts +260 -0
- package/__cjs/link/http/HttpLink.cjs +46 -0
- package/__cjs/link/http/HttpLink.cjs.map +1 -0
- package/__cjs/link/http/HttpLink.d.cts +58 -0
- package/__cjs/link/http/checkFetcher.cjs +9 -0
- package/__cjs/link/http/checkFetcher.cjs.map +1 -0
- package/__cjs/link/http/checkFetcher.d.cts +2 -0
- package/__cjs/link/http/createSignalIfSupported.cjs +17 -0
- package/__cjs/link/http/createSignalIfSupported.cjs.map +1 -0
- package/__cjs/link/http/createSignalIfSupported.d.cts +13 -0
- package/__cjs/link/http/index.cjs +24 -0
- package/__cjs/link/http/index.cjs.map +1 -0
- package/__cjs/link/http/index.d.cts +9 -0
- package/__cjs/link/http/parseAndCheckHttpResponse.cjs +163 -0
- package/__cjs/link/http/parseAndCheckHttpResponse.cjs.map +1 -0
- package/__cjs/link/http/parseAndCheckHttpResponse.d.cts +4 -0
- package/__cjs/link/http/rewriteURIForGET.cjs +55 -0
- package/__cjs/link/http/rewriteURIForGET.cjs.map +1 -0
- package/__cjs/link/http/rewriteURIForGET.d.cts +9 -0
- package/__cjs/link/http/selectHttpOptionsAndBody.cjs +109 -0
- package/__cjs/link/http/selectHttpOptionsAndBody.cjs.map +1 -0
- package/__cjs/link/http/selectHttpOptionsAndBody.d.cts +29 -0
- package/__cjs/link/http/selectURI.cjs +18 -0
- package/__cjs/link/http/selectURI.cjs.map +1 -0
- package/__cjs/link/http/selectURI.d.cts +3 -0
- package/__cjs/link/index.cjs +16 -0
- package/__cjs/link/index.cjs.map +1 -0
- package/__cjs/link/index.d.cts +10 -0
- package/__cjs/link/persisted-queries/index.cjs +248 -0
- package/__cjs/link/persisted-queries/index.cjs.map +1 -0
- package/__cjs/link/persisted-queries/index.d.cts +227 -0
- package/__cjs/link/remove-typename/index.cjs +8 -0
- package/__cjs/link/remove-typename/index.cjs.map +1 -0
- package/__cjs/link/remove-typename/index.d.cts +2 -0
- package/__cjs/link/remove-typename/removeTypenameFromVariables.cjs +156 -0
- package/__cjs/link/remove-typename/removeTypenameFromVariables.cjs.map +1 -0
- package/__cjs/link/remove-typename/removeTypenameFromVariables.d.cts +137 -0
- package/__cjs/link/retry/delayFunction.cjs +21 -0
- package/__cjs/link/retry/delayFunction.cjs.map +1 -0
- package/__cjs/link/retry/delayFunction.d.cts +3 -0
- package/__cjs/link/retry/index.cjs +6 -0
- package/__cjs/link/retry/index.cjs.map +1 -0
- package/__cjs/link/retry/index.d.cts +2 -0
- package/__cjs/link/retry/retryFunction.cjs +12 -0
- package/__cjs/link/retry/retryFunction.cjs.map +1 -0
- package/__cjs/link/retry/retryFunction.d.cts +3 -0
- package/__cjs/link/retry/retryLink.cjs +122 -0
- package/__cjs/link/retry/retryLink.cjs.map +1 -0
- package/__cjs/link/retry/retryLink.d.cts +148 -0
- package/__cjs/link/schema/index.cjs +75 -0
- package/__cjs/link/schema/index.cjs.map +1 -0
- package/__cjs/link/schema/index.d.cts +157 -0
- package/__cjs/link/subscriptions/index.cjs +101 -0
- package/__cjs/link/subscriptions/index.cjs.map +1 -0
- package/__cjs/link/subscriptions/index.d.cts +32 -0
- package/__cjs/link/utils/createOperation.cjs +37 -0
- package/__cjs/link/utils/createOperation.cjs.map +1 -0
- package/__cjs/link/utils/createOperation.d.cts +3 -0
- package/__cjs/link/utils/filterOperationVariables.cjs +25 -0
- package/__cjs/link/utils/filterOperationVariables.cjs.map +1 -0
- package/__cjs/link/utils/filterOperationVariables.d.cts +5 -0
- package/__cjs/link/utils/index.cjs +8 -0
- package/__cjs/link/utils/index.cjs.map +1 -0
- package/__cjs/link/utils/index.d.cts +3 -0
- package/__cjs/link/ws/index.cjs +56 -0
- package/__cjs/link/ws/index.cjs.map +1 -0
- package/__cjs/link/ws/index.d.cts +88 -0
- package/__cjs/local-state/LocalState.cjs +584 -0
- package/__cjs/local-state/LocalState.cjs.map +1 -0
- package/__cjs/local-state/LocalState.d.cts +183 -0
- package/__cjs/local-state/index.cjs +6 -0
- package/__cjs/local-state/index.cjs.map +1 -0
- package/__cjs/local-state/index.d.cts +2 -0
- package/__cjs/masking/GraphQLCodegenDataMasking.cjs +3 -0
- package/__cjs/masking/GraphQLCodegenDataMasking.cjs.map +1 -0
- package/__cjs/masking/GraphQLCodegenDataMasking.d.cts +46 -0
- package/__cjs/masking/PreserveTypes.cjs +3 -0
- package/__cjs/masking/PreserveTypes.cjs.map +1 -0
- package/__cjs/masking/PreserveTypes.d.cts +26 -0
- package/__cjs/masking/index.cjs +10 -0
- package/__cjs/masking/index.cjs.map +1 -0
- package/__cjs/masking/index.d.cts +6 -0
- package/__cjs/masking/internal/types.cjs +3 -0
- package/__cjs/masking/internal/types.cjs.map +1 -0
- package/__cjs/masking/internal/types.d.cts +120 -0
- package/__cjs/masking/maskDefinition.cjs +139 -0
- package/__cjs/masking/maskDefinition.cjs.map +1 -0
- package/__cjs/masking/maskDefinition.d.cts +14 -0
- package/__cjs/masking/maskFragment.cjs +41 -0
- package/__cjs/masking/maskFragment.cjs.map +1 -0
- package/__cjs/masking/maskFragment.d.cts +8 -0
- package/__cjs/masking/maskOperation.cjs +28 -0
- package/__cjs/masking/maskOperation.cjs.map +1 -0
- package/__cjs/masking/maskOperation.d.cts +8 -0
- package/__cjs/masking/types.cjs +3 -0
- package/__cjs/masking/types.cjs.map +1 -0
- package/__cjs/masking/types.d.cts +16 -0
- package/__cjs/masking/utils.cjs +47 -0
- package/__cjs/masking/utils.cjs.map +1 -0
- package/__cjs/masking/utils.d.cts +14 -0
- package/__cjs/react/context/ApolloContext.cjs +26 -0
- package/__cjs/react/context/ApolloContext.cjs.map +1 -0
- package/__cjs/react/context/ApolloContext.d.cts +9 -0
- package/__cjs/react/context/ApolloProvider.cjs +21 -0
- package/__cjs/react/context/ApolloProvider.cjs.map +1 -0
- package/__cjs/react/context/ApolloProvider.d.cts +10 -0
- package/__cjs/react/hooks/constants.cjs +5 -0
- package/__cjs/react/hooks/constants.cjs.map +1 -0
- package/__cjs/react/hooks/constants.d.cts +3 -0
- package/__cjs/react/hooks/internal/__use.cjs +26 -0
- package/__cjs/react/hooks/internal/__use.cjs.map +1 -0
- package/__cjs/react/hooks/internal/__use.d.cts +4 -0
- package/__cjs/react/hooks/internal/index.cjs +15 -0
- package/__cjs/react/hooks/internal/index.cjs.map +1 -0
- package/__cjs/react/hooks/internal/index.d.cts +6 -0
- package/__cjs/react/hooks/internal/useDeepMemo.cjs +16 -0
- package/__cjs/react/hooks/internal/useDeepMemo.cjs.map +1 -0
- package/__cjs/react/hooks/internal/useDeepMemo.d.cts +3 -0
- package/__cjs/react/hooks/internal/useIsomorphicLayoutEffect.cjs +13 -0
- package/__cjs/react/hooks/internal/useIsomorphicLayoutEffect.cjs.map +1 -0
- package/__cjs/react/hooks/internal/useIsomorphicLayoutEffect.d.cts +3 -0
- package/__cjs/react/hooks/internal/useRenderGuard.cjs +46 -0
- package/__cjs/react/hooks/internal/useRenderGuard.cjs.map +1 -0
- package/__cjs/react/hooks/internal/useRenderGuard.d.cts +2 -0
- package/__cjs/react/hooks/internal/useSuspenseHookCacheKey.cjs +28 -0
- package/__cjs/react/hooks/internal/useSuspenseHookCacheKey.cjs.map +1 -0
- package/__cjs/react/hooks/internal/useSuspenseHookCacheKey.d.cts +11 -0
- package/__cjs/react/hooks/internal/validateSuspenseHookOptions.cjs +28 -0
- package/__cjs/react/hooks/internal/validateSuspenseHookOptions.cjs.map +1 -0
- package/__cjs/react/hooks/internal/validateSuspenseHookOptions.d.cts +3 -0
- package/__cjs/react/hooks/internal/wrapHook.cjs +69 -0
- package/__cjs/react/hooks/internal/wrapHook.cjs.map +1 -0
- package/__cjs/react/hooks/internal/wrapHook.d.cts +66 -0
- package/__cjs/react/hooks/useApolloClient.cjs +29 -0
- package/__cjs/react/hooks/useApolloClient.cjs.map +1 -0
- package/__cjs/react/hooks/useApolloClient.d.cts +18 -0
- package/__cjs/react/hooks/useBackgroundQuery.cjs +76 -0
- package/__cjs/react/hooks/useBackgroundQuery.cjs.map +1 -0
- package/__cjs/react/hooks/useBackgroundQuery.d.cts +975 -0
- package/__cjs/react/hooks/useFragment.cjs +58 -0
- package/__cjs/react/hooks/useFragment.cjs.map +1 -0
- package/__cjs/react/hooks/useFragment.d.cts +162 -0
- package/__cjs/react/hooks/useLazyQuery.cjs +150 -0
- package/__cjs/react/hooks/useLazyQuery.cjs.map +1 -0
- package/__cjs/react/hooks/useLazyQuery.d.cts +436 -0
- package/__cjs/react/hooks/useLoadableQuery.cjs +92 -0
- package/__cjs/react/hooks/useLoadableQuery.cjs.map +1 -0
- package/__cjs/react/hooks/useLoadableQuery.d.cts +353 -0
- package/__cjs/react/hooks/useMutation.cjs +163 -0
- package/__cjs/react/hooks/useMutation.cjs.map +1 -0
- package/__cjs/react/hooks/useMutation.d.cts +316 -0
- package/__cjs/react/hooks/useQuery.cjs +219 -0
- package/__cjs/react/hooks/useQuery.cjs.map +1 -0
- package/__cjs/react/hooks/useQuery.d.cts +549 -0
- package/__cjs/react/hooks/useQueryRefHandlers.cjs +72 -0
- package/__cjs/react/hooks/useQueryRefHandlers.cjs.map +1 -0
- package/__cjs/react/hooks/useQueryRefHandlers.d.cts +78 -0
- package/__cjs/react/hooks/useReactiveVar.cjs +39 -0
- package/__cjs/react/hooks/useReactiveVar.cjs.map +1 -0
- package/__cjs/react/hooks/useReactiveVar.d.cts +22 -0
- package/__cjs/react/hooks/useReadQuery.cjs +74 -0
- package/__cjs/react/hooks/useReadQuery.cjs.map +1 -0
- package/__cjs/react/hooks/useReadQuery.d.cts +100 -0
- package/__cjs/react/hooks/useSubscription.cjs +226 -0
- package/__cjs/react/hooks/useSubscription.cjs.map +1 -0
- package/__cjs/react/hooks/useSubscription.d.cts +270 -0
- package/__cjs/react/hooks/useSuspenseFragment.cjs +51 -0
- package/__cjs/react/hooks/useSuspenseFragment.cjs.map +1 -0
- package/__cjs/react/hooks/useSuspenseFragment.d.cts +105 -0
- package/__cjs/react/hooks/useSuspenseQuery.cjs +123 -0
- package/__cjs/react/hooks/useSuspenseQuery.cjs.map +1 -0
- package/__cjs/react/hooks/useSuspenseQuery.d.cts +630 -0
- package/__cjs/react/hooks/useSyncExternalStore.cjs +130 -0
- package/__cjs/react/hooks/useSyncExternalStore.cjs.map +1 -0
- package/__cjs/react/hooks/useSyncExternalStore.d.cts +4 -0
- package/__cjs/react/index.cjs +39 -0
- package/__cjs/react/index.cjs.map +1 -0
- package/__cjs/react/index.d.cts +33 -0
- package/__cjs/react/index.react-server.cjs +46 -0
- package/__cjs/react/index.react-server.cjs.map +1 -0
- package/__cjs/react/index.react-server.d.cts +18 -0
- package/__cjs/react/internal/cache/FragmentReference.cjs +116 -0
- package/__cjs/react/internal/cache/FragmentReference.cjs.map +1 -0
- package/__cjs/react/internal/cache/FragmentReference.d.cts +35 -0
- package/__cjs/react/internal/cache/QueryReference.cjs +314 -0
- package/__cjs/react/internal/cache/QueryReference.cjs.map +1 -0
- package/__cjs/react/internal/cache/QueryReference.d.cts +112 -0
- package/__cjs/react/internal/cache/SuspenseCache.cjs +44 -0
- package/__cjs/react/internal/cache/SuspenseCache.cjs.map +1 -0
- package/__cjs/react/internal/cache/SuspenseCache.d.cts +29 -0
- package/__cjs/react/internal/cache/getSuspenseCache.cjs +12 -0
- package/__cjs/react/internal/cache/getSuspenseCache.cjs.map +1 -0
- package/__cjs/react/internal/cache/getSuspenseCache.d.cts +18 -0
- package/__cjs/react/internal/cache/types.cjs +3 -0
- package/__cjs/react/internal/cache/types.cjs.map +1 -0
- package/__cjs/react/internal/cache/types.d.cts +18 -0
- package/__cjs/react/internal/compiler-runtime/index.cjs +32 -0
- package/__cjs/react/internal/compiler-runtime/index.cjs.map +1 -0
- package/__cjs/react/internal/compiler-runtime/index.d.cts +8 -0
- package/__cjs/react/internal/index.cjs +14 -0
- package/__cjs/react/internal/index.cjs.map +1 -0
- package/__cjs/react/internal/index.d.cts +10 -0
- package/__cjs/react/internal/types.cjs +3 -0
- package/__cjs/react/internal/types.cjs.map +1 -0
- package/__cjs/react/internal/types.d.cts +4 -0
- package/__cjs/react/query-preloader/createQueryPreloader.cjs +85 -0
- package/__cjs/react/query-preloader/createQueryPreloader.cjs.map +1 -0
- package/__cjs/react/query-preloader/createQueryPreloader.d.cts +256 -0
- package/__cjs/react/ssr/getDataFromTree.cjs +43 -0
- package/__cjs/react/ssr/getDataFromTree.cjs.map +1 -0
- package/__cjs/react/ssr/getDataFromTree.d.cts +25 -0
- package/__cjs/react/ssr/index.cjs +11 -0
- package/__cjs/react/ssr/index.cjs.map +1 -0
- package/__cjs/react/ssr/index.d.cts +4 -0
- package/__cjs/react/ssr/prerenderStatic.cjs +172 -0
- package/__cjs/react/ssr/prerenderStatic.cjs.map +1 -0
- package/__cjs/react/ssr/prerenderStatic.d.cts +143 -0
- package/__cjs/react/ssr/renderToStringWithData.cjs +18 -0
- package/__cjs/react/ssr/renderToStringWithData.cjs.map +1 -0
- package/__cjs/react/ssr/renderToStringWithData.d.cts +8 -0
- package/__cjs/react/ssr/useSSRQuery.cjs +73 -0
- package/__cjs/react/ssr/useSSRQuery.cjs.map +1 -0
- package/__cjs/react/ssr/useSSRQuery.d.cts +6 -0
- package/__cjs/react/types/deprecated.cjs +3 -0
- package/__cjs/react/types/deprecated.cjs.map +1 -0
- package/__cjs/react/types/deprecated.d.cts +75 -0
- package/__cjs/react/types/types.documentation.cjs +3 -0
- package/__cjs/react/types/types.documentation.cjs.map +1 -0
- package/__cjs/react/types/types.documentation.d.cts +533 -0
- package/__cjs/testing/core/mocking/mockLink.cjs +193 -0
- package/__cjs/testing/core/mocking/mockLink.cjs.map +1 -0
- package/__cjs/testing/core/mocking/mockLink.d.cts +66 -0
- package/__cjs/testing/core/mocking/mockSubscriptionLink.cjs +56 -0
- package/__cjs/testing/core/mocking/mockSubscriptionLink.cjs.map +1 -0
- package/__cjs/testing/core/mocking/mockSubscriptionLink.d.cts +22 -0
- package/__cjs/testing/core/types/deprecated.cjs +3 -0
- package/__cjs/testing/core/types/deprecated.cjs.map +1 -0
- package/__cjs/testing/core/types/deprecated.d.cts +11 -0
- package/__cjs/testing/index.cjs +9 -0
- package/__cjs/testing/index.cjs.map +1 -0
- package/__cjs/testing/index.d.cts +4 -0
- package/__cjs/testing/react/MockedProvider.cjs +43 -0
- package/__cjs/testing/react/MockedProvider.cjs.map +1 -0
- package/__cjs/testing/react/MockedProvider.d.cts +33 -0
- package/__cjs/testing/react/index.cjs +6 -0
- package/__cjs/testing/react/index.cjs.map +1 -0
- package/__cjs/testing/react/index.d.cts +3 -0
- package/__cjs/utilities/DeepPartial.cjs +7 -0
- package/__cjs/utilities/DeepPartial.cjs.map +1 -0
- package/__cjs/utilities/DeepPartial.d.cts +15 -0
- package/__cjs/utilities/HKT.cjs +3 -0
- package/__cjs/utilities/HKT.cjs.map +1 -0
- package/__cjs/utilities/HKT.d.cts +36 -0
- package/__cjs/utilities/caching/index.cjs +6 -0
- package/__cjs/utilities/caching/index.cjs.map +1 -0
- package/__cjs/utilities/caching/index.d.cts +3 -0
- package/__cjs/utilities/caching/sizes.cjs +29 -0
- package/__cjs/utilities/caching/sizes.cjs.map +1 -0
- package/__cjs/utilities/caching/sizes.d.cts +286 -0
- package/__cjs/utilities/common/stripTypename.cjs +25 -0
- package/__cjs/utilities/common/stripTypename.cjs.map +1 -0
- package/__cjs/utilities/common/stripTypename.d.cts +19 -0
- package/__cjs/utilities/environment/index.cjs +5 -0
- package/__cjs/utilities/environment/index.cjs.map +1 -0
- package/__cjs/utilities/environment/index.d.cts +2 -0
- package/__cjs/utilities/environment/index.development.cjs +5 -0
- package/__cjs/utilities/environment/index.development.cjs.map +1 -0
- package/__cjs/utilities/environment/index.development.d.cts +2 -0
- package/__cjs/utilities/environment/index.production.cjs +5 -0
- package/__cjs/utilities/environment/index.production.cjs.map +1 -0
- package/__cjs/utilities/environment/index.production.d.cts +2 -0
- package/__cjs/utilities/graphql/DocumentTransform.cjs +190 -0
- package/__cjs/utilities/graphql/DocumentTransform.cjs.map +1 -0
- package/__cjs/utilities/graphql/DocumentTransform.d.cts +143 -0
- package/__cjs/utilities/graphql/isFormattedExecutionResult.cjs +36 -0
- package/__cjs/utilities/graphql/isFormattedExecutionResult.cjs.map +1 -0
- package/__cjs/utilities/graphql/isFormattedExecutionResult.d.cts +30 -0
- package/__cjs/utilities/graphql/operations.cjs +91 -0
- package/__cjs/utilities/graphql/operations.cjs.map +1 -0
- package/__cjs/utilities/graphql/operations.d.cts +77 -0
- package/__cjs/utilities/graphql/print.cjs +33 -0
- package/__cjs/utilities/graphql/print.cjs.map +1 -0
- package/__cjs/utilities/graphql/print.d.cts +13 -0
- package/__cjs/utilities/graphql/storeUtils.cjs +21 -0
- package/__cjs/utilities/graphql/storeUtils.cjs.map +1 -0
- package/__cjs/utilities/graphql/storeUtils.d.cts +52 -0
- package/__cjs/utilities/graphql/transform.cjs +74 -0
- package/__cjs/utilities/graphql/transform.cjs.map +1 -0
- package/__cjs/utilities/graphql/transform.d.cts +21 -0
- package/__cjs/utilities/index.cjs +35 -0
- package/__cjs/utilities/index.cjs.map +1 -0
- package/__cjs/utilities/index.d.cts +19 -0
- package/__cjs/utilities/internal/DeepMerger.cjs +99 -0
- package/__cjs/utilities/internal/DeepMerger.cjs.map +1 -0
- package/__cjs/utilities/internal/DeepMerger.d.cts +33 -0
- package/__cjs/utilities/internal/argumentsObjectFromField.cjs +18 -0
- package/__cjs/utilities/internal/argumentsObjectFromField.cjs.map +1 -0
- package/__cjs/utilities/internal/argumentsObjectFromField.d.cts +8 -0
- package/__cjs/utilities/internal/bindCacheKey.cjs +21 -0
- package/__cjs/utilities/internal/bindCacheKey.cjs.map +1 -0
- package/__cjs/utilities/internal/bindCacheKey.d.cts +15 -0
- package/__cjs/utilities/internal/caches.cjs +76 -0
- package/__cjs/utilities/internal/caches.cjs.map +1 -0
- package/__cjs/utilities/internal/caches.d.cts +42 -0
- package/__cjs/utilities/internal/canUseDOM.cjs +11 -0
- package/__cjs/utilities/internal/canUseDOM.cjs.map +1 -0
- package/__cjs/utilities/internal/canUseDOM.d.cts +7 -0
- package/__cjs/utilities/internal/canonicalStringify.cjs +112 -0
- package/__cjs/utilities/internal/canonicalStringify.cjs.map +1 -0
- package/__cjs/utilities/internal/canonicalStringify.d.cts +44 -0
- package/__cjs/utilities/internal/checkDocument.cjs +67 -0
- package/__cjs/utilities/internal/checkDocument.cjs.map +1 -0
- package/__cjs/utilities/internal/checkDocument.d.cts +10 -0
- package/__cjs/utilities/internal/cloneDeep.cjs +45 -0
- package/__cjs/utilities/internal/cloneDeep.cjs.map +1 -0
- package/__cjs/utilities/internal/cloneDeep.d.cts +9 -0
- package/__cjs/utilities/internal/combineLatestBatched.cjs +71 -0
- package/__cjs/utilities/internal/combineLatestBatched.cjs.map +1 -0
- package/__cjs/utilities/internal/combineLatestBatched.d.cts +14 -0
- package/__cjs/utilities/internal/compact.cjs +26 -0
- package/__cjs/utilities/internal/compact.cjs.map +1 -0
- package/__cjs/utilities/internal/compact.d.cts +11 -0
- package/__cjs/utilities/internal/constants.cjs +26 -0
- package/__cjs/utilities/internal/constants.cjs.map +1 -0
- package/__cjs/utilities/internal/constants.d.cts +23 -0
- package/__cjs/utilities/internal/createFragmentMap.cjs +19 -0
- package/__cjs/utilities/internal/createFragmentMap.cjs.map +1 -0
- package/__cjs/utilities/internal/createFragmentMap.d.cts +12 -0
- package/__cjs/utilities/internal/createFulfilledPromise.cjs +15 -0
- package/__cjs/utilities/internal/createFulfilledPromise.cjs.map +1 -0
- package/__cjs/utilities/internal/createFulfilledPromise.d.cts +8 -0
- package/__cjs/utilities/internal/createRejectedPromise.cjs +17 -0
- package/__cjs/utilities/internal/createRejectedPromise.cjs.map +1 -0
- package/__cjs/utilities/internal/createRejectedPromise.d.cts +8 -0
- package/__cjs/utilities/internal/dealias.cjs +21 -0
- package/__cjs/utilities/internal/dealias.cjs.map +1 -0
- package/__cjs/utilities/internal/dealias.d.cts +5 -0
- package/__cjs/utilities/internal/decoratePromise.cjs +33 -0
- package/__cjs/utilities/internal/decoratePromise.cjs.map +1 -0
- package/__cjs/utilities/internal/decoratePromise.d.cts +8 -0
- package/__cjs/utilities/internal/deepFreeze.cjs +39 -0
- package/__cjs/utilities/internal/deepFreeze.cjs.map +1 -0
- package/__cjs/utilities/internal/deepFreeze.d.cts +7 -0
- package/__cjs/utilities/internal/equalByQuery.cjs +93 -0
- package/__cjs/utilities/internal/equalByQuery.cjs.map +1 -0
- package/__cjs/utilities/internal/equalByQuery.d.cts +5 -0
- package/__cjs/utilities/internal/filterMap.cjs +31 -0
- package/__cjs/utilities/internal/filterMap.cjs.map +1 -0
- package/__cjs/utilities/internal/filterMap.d.cts +4 -0
- package/__cjs/utilities/internal/getDefaultValues.cjs +22 -0
- package/__cjs/utilities/internal/getDefaultValues.cjs.map +1 -0
- package/__cjs/utilities/internal/getDefaultValues.d.cts +8 -0
- package/__cjs/utilities/internal/getFragmentDefinition.cjs +17 -0
- package/__cjs/utilities/internal/getFragmentDefinition.cjs.map +1 -0
- package/__cjs/utilities/internal/getFragmentDefinition.d.cts +8 -0
- package/__cjs/utilities/internal/getFragmentDefinitions.cjs +12 -0
- package/__cjs/utilities/internal/getFragmentDefinitions.cjs.map +1 -0
- package/__cjs/utilities/internal/getFragmentDefinitions.d.cts +8 -0
- package/__cjs/utilities/internal/getFragmentFromSelection.cjs +27 -0
- package/__cjs/utilities/internal/getFragmentFromSelection.cjs.map +1 -0
- package/__cjs/utilities/internal/getFragmentFromSelection.d.cts +10 -0
- package/__cjs/utilities/internal/getFragmentQueryDocument.cjs +96 -0
- package/__cjs/utilities/internal/getFragmentQueryDocument.cjs.map +1 -0
- package/__cjs/utilities/internal/getFragmentQueryDocument.d.cts +39 -0
- package/__cjs/utilities/internal/getGraphQLErrorsFromResult.cjs +12 -0
- package/__cjs/utilities/internal/getGraphQLErrorsFromResult.cjs.map +1 -0
- package/__cjs/utilities/internal/getGraphQLErrorsFromResult.d.cts +10 -0
- package/__cjs/utilities/internal/getMainDefinition.cjs +61 -0
- package/__cjs/utilities/internal/getMainDefinition.cjs.map +1 -0
- package/__cjs/utilities/internal/getMainDefinition.d.cts +40 -0
- package/__cjs/utilities/internal/getMemoryInternals.cjs +132 -0
- package/__cjs/utilities/internal/getMemoryInternals.cjs.map +1 -0
- package/__cjs/utilities/internal/getMemoryInternals.d.cts +80 -0
- package/__cjs/utilities/internal/getOperationDefinition.cjs +14 -0
- package/__cjs/utilities/internal/getOperationDefinition.cjs.map +1 -0
- package/__cjs/utilities/internal/getOperationDefinition.d.cts +8 -0
- package/__cjs/utilities/internal/getOperationName.cjs +12 -0
- package/__cjs/utilities/internal/getOperationName.cjs.map +1 -0
- package/__cjs/utilities/internal/getOperationName.d.cts +8 -0
- package/__cjs/utilities/internal/getQueryDefinition.cjs +16 -0
- package/__cjs/utilities/internal/getQueryDefinition.cjs.map +1 -0
- package/__cjs/utilities/internal/getQueryDefinition.d.cts +8 -0
- package/__cjs/utilities/internal/getStoreKeyName.cjs +76 -0
- package/__cjs/utilities/internal/getStoreKeyName.cjs.map +1 -0
- package/__cjs/utilities/internal/getStoreKeyName.d.cts +16 -0
- package/__cjs/utilities/internal/globals/global.cjs +17 -0
- package/__cjs/utilities/internal/globals/global.cjs.map +1 -0
- package/__cjs/utilities/internal/globals/global.d.cts +3 -0
- package/__cjs/utilities/internal/globals/index.cjs +9 -0
- package/__cjs/utilities/internal/globals/index.cjs.map +1 -0
- package/__cjs/utilities/internal/globals/index.d.cts +3 -0
- package/__cjs/utilities/internal/globals/maybe.cjs +10 -0
- package/__cjs/utilities/internal/globals/maybe.cjs.map +1 -0
- package/__cjs/utilities/internal/globals/maybe.d.cts +2 -0
- package/__cjs/utilities/internal/graphQLResultHasError.cjs +12 -0
- package/__cjs/utilities/internal/graphQLResultHasError.cjs.map +1 -0
- package/__cjs/utilities/internal/graphQLResultHasError.d.cts +8 -0
- package/__cjs/utilities/internal/hasDirectives.cjs +24 -0
- package/__cjs/utilities/internal/hasDirectives.cjs.map +1 -0
- package/__cjs/utilities/internal/hasDirectives.d.cts +8 -0
- package/__cjs/utilities/internal/hasForcedResolvers.cjs +23 -0
- package/__cjs/utilities/internal/hasForcedResolvers.cjs.map +1 -0
- package/__cjs/utilities/internal/hasForcedResolvers.d.cts +3 -0
- package/__cjs/utilities/internal/index.cjs +121 -0
- package/__cjs/utilities/internal/index.cjs.map +1 -0
- package/__cjs/utilities/internal/index.d.cts +74 -0
- package/__cjs/utilities/internal/index.production.cjs +11 -0
- package/__cjs/utilities/internal/index.production.cjs.map +1 -0
- package/__cjs/utilities/internal/index.production.d.cts +3 -0
- package/__cjs/utilities/internal/isArray.cjs +12 -0
- package/__cjs/utilities/internal/isArray.cjs.map +1 -0
- package/__cjs/utilities/internal/isArray.d.cts +9 -0
- package/__cjs/utilities/internal/isDocumentNode.cjs +15 -0
- package/__cjs/utilities/internal/isDocumentNode.cjs.map +1 -0
- package/__cjs/utilities/internal/isDocumentNode.d.cts +8 -0
- package/__cjs/utilities/internal/isField.cjs +12 -0
- package/__cjs/utilities/internal/isField.cjs.map +1 -0
- package/__cjs/utilities/internal/isField.d.cts +8 -0
- package/__cjs/utilities/internal/isNonEmptyArray.cjs +12 -0
- package/__cjs/utilities/internal/isNonEmptyArray.cjs.map +1 -0
- package/__cjs/utilities/internal/isNonEmptyArray.d.cts +7 -0
- package/__cjs/utilities/internal/isNonNullObject.cjs +12 -0
- package/__cjs/utilities/internal/isNonNullObject.cjs.map +1 -0
- package/__cjs/utilities/internal/isNonNullObject.d.cts +7 -0
- package/__cjs/utilities/internal/isPlainObject.cjs +15 -0
- package/__cjs/utilities/internal/isPlainObject.cjs.map +1 -0
- package/__cjs/utilities/internal/isPlainObject.d.cts +7 -0
- package/__cjs/utilities/internal/makeReference.cjs +12 -0
- package/__cjs/utilities/internal/makeReference.cjs.map +1 -0
- package/__cjs/utilities/internal/makeReference.d.cts +8 -0
- package/__cjs/utilities/internal/makeUniqueId.cjs +18 -0
- package/__cjs/utilities/internal/makeUniqueId.cjs.map +1 -0
- package/__cjs/utilities/internal/makeUniqueId.d.cts +10 -0
- package/__cjs/utilities/internal/mapObservableFragment.cjs +27 -0
- package/__cjs/utilities/internal/mapObservableFragment.cjs.map +1 -0
- package/__cjs/utilities/internal/mapObservableFragment.d.cts +3 -0
- package/__cjs/utilities/internal/maybeDeepFreeze.cjs +17 -0
- package/__cjs/utilities/internal/maybeDeepFreeze.cjs.map +1 -0
- package/__cjs/utilities/internal/maybeDeepFreeze.d.cts +7 -0
- package/__cjs/utilities/internal/memoize.cjs +31 -0
- package/__cjs/utilities/internal/memoize.cjs.map +1 -0
- package/__cjs/utilities/internal/memoize.d.cts +8 -0
- package/__cjs/utilities/internal/mergeDeep.cjs +26 -0
- package/__cjs/utilities/internal/mergeDeep.cjs.map +1 -0
- package/__cjs/utilities/internal/mergeDeep.d.cts +8 -0
- package/__cjs/utilities/internal/mergeDeepArray.cjs +27 -0
- package/__cjs/utilities/internal/mergeDeepArray.cjs.map +1 -0
- package/__cjs/utilities/internal/mergeDeepArray.d.cts +7 -0
- package/__cjs/utilities/internal/mergeOptions.cjs +18 -0
- package/__cjs/utilities/internal/mergeOptions.cjs.map +1 -0
- package/__cjs/utilities/internal/mergeOptions.d.cts +10 -0
- package/__cjs/utilities/internal/omitDeep.cjs +48 -0
- package/__cjs/utilities/internal/omitDeep.cjs.map +1 -0
- package/__cjs/utilities/internal/omitDeep.d.cts +8 -0
- package/__cjs/utilities/internal/ponyfills/FinalizationRegistry.cjs +61 -0
- package/__cjs/utilities/internal/ponyfills/FinalizationRegistry.cjs.map +1 -0
- package/__cjs/utilities/internal/ponyfills/FinalizationRegistry.d.cts +11 -0
- package/__cjs/utilities/internal/ponyfills/index.cjs +6 -0
- package/__cjs/utilities/internal/ponyfills/index.cjs.map +1 -0
- package/__cjs/utilities/internal/ponyfills/index.d.cts +3 -0
- package/__cjs/utilities/internal/ponyfills/index.react-native.cjs +6 -0
- package/__cjs/utilities/internal/ponyfills/index.react-native.cjs.map +1 -0
- package/__cjs/utilities/internal/ponyfills/index.react-native.d.cts +2 -0
- package/__cjs/utilities/internal/preventUnhandledRejection.cjs +8 -0
- package/__cjs/utilities/internal/preventUnhandledRejection.cjs.map +1 -0
- package/__cjs/utilities/internal/preventUnhandledRejection.d.cts +2 -0
- package/__cjs/utilities/internal/removeDirectivesFromDocument.cjs +302 -0
- package/__cjs/utilities/internal/removeDirectivesFromDocument.cjs.map +1 -0
- package/__cjs/utilities/internal/removeDirectivesFromDocument.d.cts +14 -0
- package/__cjs/utilities/internal/removeFragmentSpreads.cjs +14 -0
- package/__cjs/utilities/internal/removeFragmentSpreads.cjs.map +1 -0
- package/__cjs/utilities/internal/removeFragmentSpreads.d.cts +3 -0
- package/__cjs/utilities/internal/resultKeyNameFromField.cjs +12 -0
- package/__cjs/utilities/internal/resultKeyNameFromField.cjs.map +1 -0
- package/__cjs/utilities/internal/resultKeyNameFromField.d.cts +8 -0
- package/__cjs/utilities/internal/shouldInclude.cjs +50 -0
- package/__cjs/utilities/internal/shouldInclude.cjs.map +1 -0
- package/__cjs/utilities/internal/shouldInclude.d.cts +8 -0
- package/__cjs/utilities/internal/storeKeyNameFromField.cjs +29 -0
- package/__cjs/utilities/internal/storeKeyNameFromField.cjs.map +1 -0
- package/__cjs/utilities/internal/storeKeyNameFromField.d.cts +8 -0
- package/__cjs/utilities/internal/stringifyForDisplay.cjs +18 -0
- package/__cjs/utilities/internal/stringifyForDisplay.cjs.map +1 -0
- package/__cjs/utilities/internal/stringifyForDisplay.d.cts +7 -0
- package/__cjs/utilities/internal/toQueryResult.cjs +18 -0
- package/__cjs/utilities/internal/toQueryResult.cjs.map +1 -0
- package/__cjs/utilities/internal/toQueryResult.d.cts +8 -0
- package/__cjs/utilities/internal/types/ApplyHKT.cjs +3 -0
- package/__cjs/utilities/internal/types/ApplyHKT.cjs.map +1 -0
- package/__cjs/utilities/internal/types/ApplyHKT.d.cts +13 -0
- package/__cjs/utilities/internal/types/ApplyHKTImplementationWithDefault.cjs +3 -0
- package/__cjs/utilities/internal/types/ApplyHKTImplementationWithDefault.cjs.map +1 -0
- package/__cjs/utilities/internal/types/ApplyHKTImplementationWithDefault.d.cts +11 -0
- package/__cjs/utilities/internal/types/DecoratedPromise.cjs +3 -0
- package/__cjs/utilities/internal/types/DecoratedPromise.cjs.map +1 -0
- package/__cjs/utilities/internal/types/DecoratedPromise.d.cts +10 -0
- package/__cjs/utilities/internal/types/DeepOmit.cjs +3 -0
- package/__cjs/utilities/internal/types/DeepOmit.cjs.map +1 -0
- package/__cjs/utilities/internal/types/DeepOmit.d.cts +15 -0
- package/__cjs/utilities/internal/types/DocumentationTypes.cjs +3 -0
- package/__cjs/utilities/internal/types/DocumentationTypes.cjs.map +1 -0
- package/__cjs/utilities/internal/types/DocumentationTypes.d.cts +88 -0
- package/__cjs/utilities/internal/types/ExtensionsWithStreamDetails.cjs +3 -0
- package/__cjs/utilities/internal/types/ExtensionsWithStreamDetails.cjs.map +1 -0
- package/__cjs/utilities/internal/types/ExtensionsWithStreamDetails.d.cts +12 -0
- package/__cjs/utilities/internal/types/FragmentMap.cjs +3 -0
- package/__cjs/utilities/internal/types/FragmentMap.cjs.map +1 -0
- package/__cjs/utilities/internal/types/FragmentMap.d.cts +12 -0
- package/__cjs/utilities/internal/types/FragmentMapFunction.cjs +3 -0
- package/__cjs/utilities/internal/types/FragmentMapFunction.cjs.map +1 -0
- package/__cjs/utilities/internal/types/FragmentMapFunction.d.cts +8 -0
- package/__cjs/utilities/internal/types/FulfilledPromise.cjs +3 -0
- package/__cjs/utilities/internal/types/FulfilledPromise.cjs.map +1 -0
- package/__cjs/utilities/internal/types/FulfilledPromise.d.cts +10 -0
- package/__cjs/utilities/internal/types/IsAny.cjs +3 -0
- package/__cjs/utilities/internal/types/IsAny.cjs.map +1 -0
- package/__cjs/utilities/internal/types/IsAny.d.cts +7 -0
- package/__cjs/utilities/internal/types/NoInfer.cjs +3 -0
- package/__cjs/utilities/internal/types/NoInfer.cjs.map +1 -0
- package/__cjs/utilities/internal/types/NoInfer.d.cts +35 -0
- package/__cjs/utilities/internal/types/PendingPromise.cjs +3 -0
- package/__cjs/utilities/internal/types/PendingPromise.cjs.map +1 -0
- package/__cjs/utilities/internal/types/PendingPromise.d.cts +9 -0
- package/__cjs/utilities/internal/types/Prettify.cjs +3 -0
- package/__cjs/utilities/internal/types/Prettify.cjs.map +1 -0
- package/__cjs/utilities/internal/types/Prettify.d.cts +9 -0
- package/__cjs/utilities/internal/types/Primitive.cjs +3 -0
- package/__cjs/utilities/internal/types/Primitive.cjs.map +1 -0
- package/__cjs/utilities/internal/types/Primitive.d.cts +7 -0
- package/__cjs/utilities/internal/types/RejectedPromise.cjs +3 -0
- package/__cjs/utilities/internal/types/RejectedPromise.cjs.map +1 -0
- package/__cjs/utilities/internal/types/RejectedPromise.d.cts +10 -0
- package/__cjs/utilities/internal/types/RemoveIndexSignature.cjs +3 -0
- package/__cjs/utilities/internal/types/RemoveIndexSignature.cjs.map +1 -0
- package/__cjs/utilities/internal/types/RemoveIndexSignature.d.cts +9 -0
- package/__cjs/utilities/internal/types/StreamInfoTrie.cjs +3 -0
- package/__cjs/utilities/internal/types/StreamInfoTrie.cjs.map +1 -0
- package/__cjs/utilities/internal/types/StreamInfoTrie.d.cts +16 -0
- package/__cjs/utilities/internal/types/TupleToIntersection.cjs +3 -0
- package/__cjs/utilities/internal/types/TupleToIntersection.cjs.map +1 -0
- package/__cjs/utilities/internal/types/TupleToIntersection.d.cts +2 -0
- package/__cjs/utilities/internal/types/VariablesOption.cjs +3 -0
- package/__cjs/utilities/internal/types/VariablesOption.cjs.map +1 -0
- package/__cjs/utilities/internal/types/VariablesOption.d.cts +26 -0
- package/__cjs/utilities/internal/valueToObjectRepresentation.cjs +44 -0
- package/__cjs/utilities/internal/valueToObjectRepresentation.cjs.map +1 -0
- package/__cjs/utilities/internal/valueToObjectRepresentation.d.cts +8 -0
- package/__cjs/utilities/invariant/index.cjs +100 -0
- package/__cjs/utilities/invariant/index.cjs.map +1 -0
- package/__cjs/utilities/invariant/index.d.cts +47 -0
- package/__cjs/utilities/invariant/index.development.cjs +16 -0
- package/__cjs/utilities/invariant/index.development.cjs.map +1 -0
- package/__cjs/utilities/invariant/index.development.d.cts +4 -0
- package/__cjs/utilities/isNetworkRequestInFlight.cjs +12 -0
- package/__cjs/utilities/isNetworkRequestInFlight.cjs.map +1 -0
- package/__cjs/utilities/isNetworkRequestInFlight.d.cts +7 -0
- package/__cjs/utilities/isNetworkRequestSettled.cjs +11 -0
- package/__cjs/utilities/isNetworkRequestSettled.cjs.map +1 -0
- package/__cjs/utilities/isNetworkRequestSettled.d.cts +7 -0
- package/__cjs/utilities/policies/pagination.cjs +238 -0
- package/__cjs/utilities/policies/pagination.cjs.map +1 -0
- package/__cjs/utilities/policies/pagination.d.cts +51 -0
- package/__cjs/utilities/subscriptions/relay/index.cjs +62 -0
- package/__cjs/utilities/subscriptions/relay/index.cjs.map +1 -0
- package/__cjs/utilities/subscriptions/relay/index.d.cts +10 -0
- package/__cjs/v4-migration.cjs +9 -0
- package/__cjs/v4-migration.cjs.map +1 -0
- package/__cjs/v4-migration.d.cts +826 -0
- package/__cjs/version.cjs +6 -0
- package/__cjs/version.cjs.map +1 -0
- package/__cjs/version.d.cts +3 -0
- package/cache/core/cache.d.ts +291 -0
- package/cache/core/cache.js +354 -0
- package/cache/core/cache.js.map +1 -0
- package/cache/core/types/Cache.d.ts +302 -0
- package/cache/core/types/Cache.js +2 -0
- package/cache/core/types/Cache.js.map +1 -0
- package/cache/core/types/common.d.ts +64 -0
- package/cache/core/types/common.js +29 -0
- package/cache/core/types/common.js.map +1 -0
- package/cache/deprecated.d.ts +6 -0
- package/cache/deprecated.js +2 -0
- package/cache/deprecated.js.map +1 -0
- package/cache/index.d.ts +19 -0
- package/cache/index.js +10 -0
- package/cache/index.js.map +1 -0
- package/cache/inmemory/entityStore.d.ts +94 -0
- package/cache/inmemory/entityStore.js +669 -0
- package/cache/inmemory/entityStore.js.map +1 -0
- package/cache/inmemory/fragmentRegistry.d.ts +9 -0
- package/cache/inmemory/fragmentRegistry.js +131 -0
- package/cache/inmemory/fragmentRegistry.js.map +1 -0
- package/cache/inmemory/helpers.d.ts +21 -0
- package/cache/inmemory/helpers.js +82 -0
- package/cache/inmemory/helpers.js.map +1 -0
- package/cache/inmemory/inMemoryCache.d.ts +114 -0
- package/cache/inmemory/inMemoryCache.js +506 -0
- package/cache/inmemory/inMemoryCache.js.map +1 -0
- package/cache/inmemory/key-extractor.d.ts +9 -0
- package/cache/inmemory/key-extractor.js +185 -0
- package/cache/inmemory/key-extractor.js.map +1 -0
- package/cache/inmemory/policies.d.ts +126 -0
- package/cache/inmemory/policies.js +664 -0
- package/cache/inmemory/policies.js.map +1 -0
- package/cache/inmemory/reactiveVars.d.ts +19 -0
- package/cache/inmemory/reactiveVars.js +83 -0
- package/cache/inmemory/reactiveVars.js.map +1 -0
- package/cache/inmemory/readFromStore.d.ts +26 -0
- package/cache/inmemory/readFromStore.js +289 -0
- package/cache/inmemory/readFromStore.js.map +1 -0
- package/cache/inmemory/types.d.ts +109 -0
- package/cache/inmemory/types.js +2 -0
- package/cache/inmemory/types.js.map +1 -0
- package/cache/inmemory/writeToStore.d.ts +38 -0
- package/cache/inmemory/writeToStore.js +586 -0
- package/cache/inmemory/writeToStore.js.map +1 -0
- package/changes.json +26 -0
- package/core/ApolloClient.d.ts +1210 -0
- package/core/ApolloClient.js +531 -0
- package/core/ApolloClient.js.map +1 -0
- package/core/ObservableQuery.d.ts +467 -0
- package/core/ObservableQuery.js +1404 -0
- package/core/ObservableQuery.js.map +1 -0
- package/core/QueryInfo.d.ts +70 -0
- package/core/QueryInfo.js +397 -0
- package/core/QueryInfo.js.map +1 -0
- package/core/QueryManager.d.ts +168 -0
- package/core/QueryManager.js +1147 -0
- package/core/QueryManager.js.map +1 -0
- package/core/deprecated.d.ts +29 -0
- package/core/deprecated.js +2 -0
- package/core/deprecated.js.map +1 -0
- package/core/index.d.ts +31 -0
- package/core/index.js +34 -0
- package/core/index.js.map +1 -0
- package/core/networkStatus.d.ts +47 -0
- package/core/networkStatus.js +48 -0
- package/core/networkStatus.js.map +1 -0
- package/core/types.d.ts +327 -0
- package/core/types.js +2 -0
- package/core/types.js.map +1 -0
- package/core/watchQueryOptions.d.ts +75 -0
- package/core/watchQueryOptions.js +2 -0
- package/core/watchQueryOptions.js.map +1 -0
- package/dev/index.d.ts +6 -0
- package/dev/index.js +5 -0
- package/dev/index.js.map +1 -0
- package/dev/loadDevMessages.d.ts +2 -0
- package/dev/loadDevMessages.js +6 -0
- package/dev/loadDevMessages.js.map +1 -0
- package/dev/loadErrorMessageHandler.d.ts +8 -0
- package/dev/loadErrorMessageHandler.js +24 -0
- package/dev/loadErrorMessageHandler.js.map +1 -0
- package/dev/loadErrorMessages.d.ts +2 -0
- package/dev/loadErrorMessages.js +6 -0
- package/dev/loadErrorMessages.js.map +1 -0
- package/dev/setErrorMessageHandler.d.ts +34 -0
- package/dev/setErrorMessageHandler.js +9 -0
- package/dev/setErrorMessageHandler.js.map +1 -0
- package/dev/symbol.d.ts +10 -0
- package/dev/symbol.js +4 -0
- package/dev/symbol.js.map +1 -0
- package/errors/CombinedGraphQLErrors.d.ts +191 -0
- package/errors/CombinedGraphQLErrors.js +101 -0
- package/errors/CombinedGraphQLErrors.js.map +1 -0
- package/errors/CombinedProtocolErrors.d.ts +150 -0
- package/errors/CombinedProtocolErrors.js +80 -0
- package/errors/CombinedProtocolErrors.js.map +1 -0
- package/errors/LinkError.d.ts +61 -0
- package/errors/LinkError.js +63 -0
- package/errors/LinkError.js.map +1 -0
- package/errors/LocalStateError.d.ts +56 -0
- package/errors/LocalStateError.js +53 -0
- package/errors/LocalStateError.js.map +1 -0
- package/errors/ServerError.d.ts +87 -0
- package/errors/ServerError.js +75 -0
- package/errors/ServerError.js.map +1 -0
- package/errors/ServerParseError.d.ts +82 -0
- package/errors/ServerParseError.js +72 -0
- package/errors/ServerParseError.js.map +1 -0
- package/errors/UnconventionalError.d.ts +55 -0
- package/errors/UnconventionalError.js +63 -0
- package/errors/UnconventionalError.js.map +1 -0
- package/errors/index.d.ts +14 -0
- package/errors/index.js +31 -0
- package/errors/index.js.map +1 -0
- package/errors/isErrorLike.d.ts +3 -0
- package/errors/isErrorLike.js +9 -0
- package/errors/isErrorLike.js.map +1 -0
- package/errors/utils.d.ts +3 -0
- package/errors/utils.js +14 -0
- package/errors/utils.js.map +1 -0
- package/incremental/handlers/defer20220824.d.ts +66 -0
- package/incremental/handlers/defer20220824.js +122 -0
- package/incremental/handlers/defer20220824.js.map +1 -0
- package/incremental/handlers/graphql17Alpha9.d.ts +98 -0
- package/incremental/handlers/graphql17Alpha9.js +223 -0
- package/incremental/handlers/graphql17Alpha9.js.map +1 -0
- package/incremental/handlers/notImplemented.d.ts +20 -0
- package/incremental/handlers/notImplemented.js +15 -0
- package/incremental/handlers/notImplemented.js.map +1 -0
- package/incremental/index.d.ts +5 -0
- package/incremental/index.js +4 -0
- package/incremental/index.js.map +1 -0
- package/incremental/types.d.ts +33 -0
- package/incremental/types.js +2 -0
- package/incremental/types.js.map +1 -0
- package/invariantErrorCodes.d.ts +13 -0
- package/invariantErrorCodes.js +725 -0
- package/invariantErrorCodes.js.map +1 -0
- package/legacyEntryPoints/apollo-client.cjs +1 -0
- package/legacyEntryPoints/apollo-client.d.cts +1 -0
- package/legacyEntryPoints/cache/cache.cjs +1 -0
- package/legacyEntryPoints/cache/cache.d.cts +1 -0
- package/legacyEntryPoints/cache/index.d.ts +1 -0
- package/legacyEntryPoints/cache/index.js +1 -0
- package/legacyEntryPoints/core/core.cjs +1 -0
- package/legacyEntryPoints/core/core.d.cts +1 -0
- package/legacyEntryPoints/core/index.d.ts +1 -0
- package/legacyEntryPoints/core/index.js +1 -0
- package/legacyEntryPoints/dev/dev.cjs +1 -0
- package/legacyEntryPoints/dev/dev.d.cts +1 -0
- package/legacyEntryPoints/dev/index.d.ts +1 -0
- package/legacyEntryPoints/dev/index.js +1 -0
- package/legacyEntryPoints/errors/errors.cjs +1 -0
- package/legacyEntryPoints/errors/errors.d.cts +1 -0
- package/legacyEntryPoints/errors/index.d.ts +1 -0
- package/legacyEntryPoints/errors/index.js +1 -0
- package/legacyEntryPoints/incremental/incremental.cjs +1 -0
- package/legacyEntryPoints/incremental/incremental.d.cts +1 -0
- package/legacyEntryPoints/incremental/index.d.ts +1 -0
- package/legacyEntryPoints/incremental/index.js +1 -0
- package/legacyEntryPoints/index.d.ts +1 -0
- package/legacyEntryPoints/index.js +1 -0
- package/legacyEntryPoints/link/batch/batch.cjs +1 -0
- package/legacyEntryPoints/link/batch/batch.d.cts +1 -0
- package/legacyEntryPoints/link/batch/index.d.ts +1 -0
- package/legacyEntryPoints/link/batch/index.js +1 -0
- package/legacyEntryPoints/link/batch-http/batch-http.cjs +1 -0
- package/legacyEntryPoints/link/batch-http/batch-http.d.cts +1 -0
- package/legacyEntryPoints/link/batch-http/index.d.ts +1 -0
- package/legacyEntryPoints/link/batch-http/index.js +1 -0
- package/legacyEntryPoints/link/client-awareness/client-awareness.cjs +1 -0
- package/legacyEntryPoints/link/client-awareness/client-awareness.d.cts +1 -0
- package/legacyEntryPoints/link/client-awareness/index.d.ts +1 -0
- package/legacyEntryPoints/link/client-awareness/index.js +1 -0
- package/legacyEntryPoints/link/context/context.cjs +1 -0
- package/legacyEntryPoints/link/context/context.d.cts +1 -0
- package/legacyEntryPoints/link/context/index.d.ts +1 -0
- package/legacyEntryPoints/link/context/index.js +1 -0
- package/legacyEntryPoints/link/error/error.cjs +1 -0
- package/legacyEntryPoints/link/error/error.d.cts +1 -0
- package/legacyEntryPoints/link/error/index.d.ts +1 -0
- package/legacyEntryPoints/link/error/index.js +1 -0
- package/legacyEntryPoints/link/http/http.cjs +1 -0
- package/legacyEntryPoints/link/http/http.d.cts +1 -0
- package/legacyEntryPoints/link/http/index.d.ts +1 -0
- package/legacyEntryPoints/link/http/index.js +1 -0
- package/legacyEntryPoints/link/index.d.ts +1 -0
- package/legacyEntryPoints/link/index.js +1 -0
- package/legacyEntryPoints/link/link.cjs +1 -0
- package/legacyEntryPoints/link/link.d.cts +1 -0
- package/legacyEntryPoints/link/persisted-queries/index.d.ts +1 -0
- package/legacyEntryPoints/link/persisted-queries/index.js +1 -0
- package/legacyEntryPoints/link/persisted-queries/persisted-queries.cjs +1 -0
- package/legacyEntryPoints/link/persisted-queries/persisted-queries.d.cts +1 -0
- package/legacyEntryPoints/link/remove-typename/index.d.ts +1 -0
- package/legacyEntryPoints/link/remove-typename/index.js +1 -0
- package/legacyEntryPoints/link/remove-typename/remove-typename.cjs +1 -0
- package/legacyEntryPoints/link/remove-typename/remove-typename.d.cts +1 -0
- package/legacyEntryPoints/link/retry/index.d.ts +1 -0
- package/legacyEntryPoints/link/retry/index.js +1 -0
- package/legacyEntryPoints/link/retry/retry.cjs +1 -0
- package/legacyEntryPoints/link/retry/retry.d.cts +1 -0
- package/legacyEntryPoints/link/schema/index.d.ts +1 -0
- package/legacyEntryPoints/link/schema/index.js +1 -0
- package/legacyEntryPoints/link/schema/schema.cjs +1 -0
- package/legacyEntryPoints/link/schema/schema.d.cts +1 -0
- package/legacyEntryPoints/link/subscriptions/index.d.ts +1 -0
- package/legacyEntryPoints/link/subscriptions/index.js +1 -0
- package/legacyEntryPoints/link/subscriptions/subscriptions.cjs +1 -0
- package/legacyEntryPoints/link/subscriptions/subscriptions.d.cts +1 -0
- package/legacyEntryPoints/link/utils/index.d.ts +1 -0
- package/legacyEntryPoints/link/utils/index.js +1 -0
- package/legacyEntryPoints/link/utils/utils.cjs +1 -0
- package/legacyEntryPoints/link/utils/utils.d.cts +1 -0
- package/legacyEntryPoints/link/ws/index.d.ts +1 -0
- package/legacyEntryPoints/link/ws/index.js +1 -0
- package/legacyEntryPoints/link/ws/ws.cjs +1 -0
- package/legacyEntryPoints/link/ws/ws.d.cts +1 -0
- package/legacyEntryPoints/local-state/index.d.ts +1 -0
- package/legacyEntryPoints/local-state/index.js +1 -0
- package/legacyEntryPoints/local-state/local-state.cjs +1 -0
- package/legacyEntryPoints/local-state/local-state.d.cts +1 -0
- package/legacyEntryPoints/main.cjs +1 -0
- package/legacyEntryPoints/main.d.cts +1 -0
- package/legacyEntryPoints/masking/index.d.ts +1 -0
- package/legacyEntryPoints/masking/index.js +1 -0
- package/legacyEntryPoints/masking/masking.cjs +1 -0
- package/legacyEntryPoints/masking/masking.d.cts +1 -0
- package/legacyEntryPoints/react/index.d.ts +1 -0
- package/legacyEntryPoints/react/index.js +1 -0
- package/legacyEntryPoints/react/internal/compiler-runtime/compiler-runtime.cjs +1 -0
- package/legacyEntryPoints/react/internal/compiler-runtime/compiler-runtime.d.cts +1 -0
- package/legacyEntryPoints/react/internal/compiler-runtime/index.d.ts +1 -0
- package/legacyEntryPoints/react/internal/compiler-runtime/index.js +1 -0
- package/legacyEntryPoints/react/internal/index.d.ts +1 -0
- package/legacyEntryPoints/react/internal/index.js +1 -0
- package/legacyEntryPoints/react/internal/internal.cjs +1 -0
- package/legacyEntryPoints/react/internal/internal.d.cts +1 -0
- package/legacyEntryPoints/react/react.cjs +1 -0
- package/legacyEntryPoints/react/react.d.cts +1 -0
- package/legacyEntryPoints/react/ssr/index.d.ts +1 -0
- package/legacyEntryPoints/react/ssr/index.js +1 -0
- package/legacyEntryPoints/react/ssr/ssr.cjs +1 -0
- package/legacyEntryPoints/react/ssr/ssr.d.cts +1 -0
- package/legacyEntryPoints/testing/index.d.ts +1 -0
- package/legacyEntryPoints/testing/index.js +1 -0
- package/legacyEntryPoints/testing/react/index.d.ts +1 -0
- package/legacyEntryPoints/testing/react/index.js +1 -0
- package/legacyEntryPoints/testing/react/react.cjs +1 -0
- package/legacyEntryPoints/testing/react/react.d.cts +1 -0
- package/legacyEntryPoints/testing/testing.cjs +1 -0
- package/legacyEntryPoints/testing/testing.d.cts +1 -0
- package/legacyEntryPoints/utilities/environment/environment.cjs +1 -0
- package/legacyEntryPoints/utilities/environment/environment.d.cts +1 -0
- package/legacyEntryPoints/utilities/environment/index.d.ts +1 -0
- package/legacyEntryPoints/utilities/environment/index.js +1 -0
- package/legacyEntryPoints/utilities/index.d.ts +1 -0
- package/legacyEntryPoints/utilities/index.js +1 -0
- package/legacyEntryPoints/utilities/internal/globals/globals.cjs +1 -0
- package/legacyEntryPoints/utilities/internal/globals/globals.d.cts +1 -0
- package/legacyEntryPoints/utilities/internal/globals/index.d.ts +1 -0
- package/legacyEntryPoints/utilities/internal/globals/index.js +1 -0
- package/legacyEntryPoints/utilities/internal/index.d.ts +1 -0
- package/legacyEntryPoints/utilities/internal/index.js +1 -0
- package/legacyEntryPoints/utilities/internal/internal.cjs +1 -0
- package/legacyEntryPoints/utilities/internal/internal.d.cts +1 -0
- package/legacyEntryPoints/utilities/internal/ponyfills/index.d.ts +1 -0
- package/legacyEntryPoints/utilities/internal/ponyfills/index.js +1 -0
- package/legacyEntryPoints/utilities/internal/ponyfills/ponyfills.cjs +1 -0
- package/legacyEntryPoints/utilities/internal/ponyfills/ponyfills.d.cts +1 -0
- package/legacyEntryPoints/utilities/invariant/index.d.ts +1 -0
- package/legacyEntryPoints/utilities/invariant/index.js +1 -0
- package/legacyEntryPoints/utilities/invariant/invariant.cjs +1 -0
- package/legacyEntryPoints/utilities/invariant/invariant.d.cts +1 -0
- package/legacyEntryPoints/utilities/subscriptions/relay/index.d.ts +1 -0
- package/legacyEntryPoints/utilities/subscriptions/relay/index.js +1 -0
- package/legacyEntryPoints/utilities/subscriptions/relay/relay.cjs +1 -0
- package/legacyEntryPoints/utilities/subscriptions/relay/relay.d.cts +1 -0
- package/legacyEntryPoints/utilities/utilities.cjs +1 -0
- package/legacyEntryPoints/utilities/utilities.d.cts +1 -0
- package/legacyEntryPoints/v4-migration/index.d.ts +1 -0
- package/legacyEntryPoints/v4-migration/index.js +1 -0
- package/legacyEntryPoints/v4-migration/v4-migration.cjs +1 -0
- package/legacyEntryPoints/v4-migration/v4-migration.d.cts +1 -0
- package/link/batch/batchLink.d.ts +117 -0
- package/link/batch/batchLink.js +49 -0
- package/link/batch/batchLink.js.map +1 -0
- package/link/batch/batching.d.ts +27 -0
- package/link/batch/batching.js +152 -0
- package/link/batch/batching.js.map +1 -0
- package/link/batch/index.d.ts +2 -0
- package/link/batch/index.js +2 -0
- package/link/batch/index.js.map +1 -0
- package/link/batch-http/BaseBatchHttpLink.d.ts +68 -0
- package/link/batch-http/BaseBatchHttpLink.js +152 -0
- package/link/batch-http/BaseBatchHttpLink.js.map +1 -0
- package/link/batch-http/batchHttpLink.d.ts +49 -0
- package/link/batch-http/batchHttpLink.js +38 -0
- package/link/batch-http/batchHttpLink.js.map +1 -0
- package/link/batch-http/index.d.ts +3 -0
- package/link/batch-http/index.js +3 -0
- package/link/batch-http/index.js.map +1 -0
- package/link/client-awareness/ClientAwarenessLink.d.ts +114 -0
- package/link/client-awareness/ClientAwarenessLink.js +86 -0
- package/link/client-awareness/ClientAwarenessLink.js.map +1 -0
- package/link/client-awareness/index.d.ts +2 -0
- package/link/client-awareness/index.js +2 -0
- package/link/client-awareness/index.js.map +1 -0
- package/link/context/index.d.ts +85 -0
- package/link/context/index.js +63 -0
- package/link/context/index.js.map +1 -0
- package/link/core/ApolloLink.d.ts +384 -0
- package/link/core/ApolloLink.js +266 -0
- package/link/core/ApolloLink.js.map +1 -0
- package/link/core/concat.d.ts +7 -0
- package/link/core/concat.js +7 -0
- package/link/core/concat.js.map +1 -0
- package/link/core/deprecated.d.ts +10 -0
- package/link/core/deprecated.js +2 -0
- package/link/core/deprecated.js.map +1 -0
- package/link/core/empty.d.ts +7 -0
- package/link/core/empty.js +7 -0
- package/link/core/empty.js.map +1 -0
- package/link/core/execute.d.ts +3 -0
- package/link/core/execute.js +3 -0
- package/link/core/execute.js.map +1 -0
- package/link/core/from.d.ts +7 -0
- package/link/core/from.js +7 -0
- package/link/core/from.js.map +1 -0
- package/link/core/split.d.ts +7 -0
- package/link/core/split.js +7 -0
- package/link/core/split.js.map +1 -0
- package/link/core/types.d.ts +6 -0
- package/link/core/types.js +2 -0
- package/link/core/types.js.map +1 -0
- package/link/error/index.d.ts +105 -0
- package/link/error/index.js +124 -0
- package/link/error/index.js.map +1 -0
- package/link/http/BaseHttpLink.d.ts +260 -0
- package/link/http/BaseHttpLink.js +157 -0
- package/link/http/BaseHttpLink.js.map +1 -0
- package/link/http/HttpLink.d.ts +58 -0
- package/link/http/HttpLink.js +41 -0
- package/link/http/HttpLink.js.map +1 -0
- package/link/http/checkFetcher.d.ts +2 -0
- package/link/http/checkFetcher.js +5 -0
- package/link/http/checkFetcher.js.map +1 -0
- package/link/http/createSignalIfSupported.d.ts +13 -0
- package/link/http/createSignalIfSupported.js +13 -0
- package/link/http/createSignalIfSupported.js.map +1 -0
- package/link/http/index.d.ts +9 -0
- package/link/http/index.js +10 -0
- package/link/http/index.js.map +1 -0
- package/link/http/parseAndCheckHttpResponse.d.ts +4 -0
- package/link/http/parseAndCheckHttpResponse.js +159 -0
- package/link/http/parseAndCheckHttpResponse.js.map +1 -0
- package/link/http/rewriteURIForGET.d.ts +9 -0
- package/link/http/rewriteURIForGET.js +52 -0
- package/link/http/rewriteURIForGET.js.map +1 -0
- package/link/http/selectHttpOptionsAndBody.d.ts +29 -0
- package/link/http/selectHttpOptionsAndBody.js +103 -0
- package/link/http/selectHttpOptionsAndBody.js.map +1 -0
- package/link/http/selectURI.d.ts +3 -0
- package/link/http/selectURI.js +14 -0
- package/link/http/selectURI.js.map +1 -0
- package/link/index.d.ts +10 -0
- package/link/index.js +7 -0
- package/link/index.js.map +1 -0
- package/link/persisted-queries/index.d.ts +227 -0
- package/link/persisted-queries/index.js +243 -0
- package/link/persisted-queries/index.js.map +1 -0
- package/link/remove-typename/index.d.ts +2 -0
- package/link/remove-typename/index.js +2 -0
- package/link/remove-typename/index.js.map +1 -0
- package/link/remove-typename/removeTypenameFromVariables.d.ts +137 -0
- package/link/remove-typename/removeTypenameFromVariables.js +151 -0
- package/link/remove-typename/removeTypenameFromVariables.js.map +1 -0
- package/link/retry/delayFunction.d.ts +3 -0
- package/link/retry/delayFunction.js +18 -0
- package/link/retry/delayFunction.js.map +1 -0
- package/link/retry/index.d.ts +2 -0
- package/link/retry/index.js +2 -0
- package/link/retry/index.js.map +1 -0
- package/link/retry/retryFunction.d.ts +3 -0
- package/link/retry/retryFunction.js +9 -0
- package/link/retry/retryFunction.js.map +1 -0
- package/link/retry/retryLink.d.ts +148 -0
- package/link/retry/retryLink.js +118 -0
- package/link/retry/retryLink.js.map +1 -0
- package/link/schema/index.d.ts +157 -0
- package/link/schema/index.js +71 -0
- package/link/schema/index.js.map +1 -0
- package/link/subscriptions/index.d.ts +32 -0
- package/link/subscriptions/index.js +97 -0
- package/link/subscriptions/index.js.map +1 -0
- package/link/utils/createOperation.d.ts +3 -0
- package/link/utils/createOperation.js +34 -0
- package/link/utils/createOperation.js.map +1 -0
- package/link/utils/filterOperationVariables.d.ts +5 -0
- package/link/utils/filterOperationVariables.js +22 -0
- package/link/utils/filterOperationVariables.js.map +1 -0
- package/link/utils/index.d.ts +3 -0
- package/link/utils/index.js +3 -0
- package/link/utils/index.js.map +1 -0
- package/link/ws/index.d.ts +88 -0
- package/link/ws/index.js +48 -0
- package/link/ws/index.js.map +1 -0
- package/local-state/LocalState.d.ts +183 -0
- package/local-state/LocalState.js +576 -0
- package/local-state/LocalState.js.map +1 -0
- package/local-state/index.d.ts +2 -0
- package/local-state/index.js +2 -0
- package/local-state/index.js.map +1 -0
- package/masking/GraphQLCodegenDataMasking.d.ts +46 -0
- package/masking/GraphQLCodegenDataMasking.js +2 -0
- package/masking/GraphQLCodegenDataMasking.js.map +1 -0
- package/masking/PreserveTypes.d.ts +26 -0
- package/masking/PreserveTypes.js +2 -0
- package/masking/PreserveTypes.js.map +1 -0
- package/masking/index.d.ts +6 -0
- package/masking/index.js +4 -0
- package/masking/index.js.map +1 -0
- package/masking/internal/types.d.ts +120 -0
- package/masking/internal/types.js +2 -0
- package/masking/internal/types.js.map +1 -0
- package/masking/maskDefinition.d.ts +14 -0
- package/masking/maskDefinition.js +132 -0
- package/masking/maskDefinition.js.map +1 -0
- package/masking/maskFragment.d.ts +8 -0
- package/masking/maskFragment.js +38 -0
- package/masking/maskFragment.js.map +1 -0
- package/masking/maskOperation.d.ts +8 -0
- package/masking/maskOperation.js +25 -0
- package/masking/maskOperation.js.map +1 -0
- package/masking/types.d.ts +16 -0
- package/masking/types.js +2 -0
- package/masking/types.js.map +1 -0
- package/masking/utils.d.ts +14 -0
- package/masking/utils.js +39 -0
- package/masking/utils.js.map +1 -0
- package/package.json +383 -0
- package/react/compiled/index.d.ts +2 -0
- package/react/compiled/index.js +2 -0
- package/react/compiled/index.js.map +1 -0
- package/react/context/ApolloContext.d.ts +9 -0
- package/react/context/ApolloContext.js +22 -0
- package/react/context/ApolloContext.js.map +1 -0
- package/react/context/ApolloProvider.d.ts +10 -0
- package/react/context/ApolloProvider.js +16 -0
- package/react/context/ApolloProvider.js.map +1 -0
- package/react/hooks/constants.d.ts +3 -0
- package/react/hooks/constants.js +2 -0
- package/react/hooks/constants.js.map +1 -0
- package/react/hooks/internal/__use.d.ts +4 -0
- package/react/hooks/internal/__use.js +22 -0
- package/react/hooks/internal/__use.js.map +1 -0
- package/react/hooks/internal/index.d.ts +6 -0
- package/react/hooks/internal/index.js +7 -0
- package/react/hooks/internal/index.js.map +1 -0
- package/react/hooks/internal/useDeepMemo.d.ts +3 -0
- package/react/hooks/internal/useDeepMemo.js +12 -0
- package/react/hooks/internal/useDeepMemo.js.map +1 -0
- package/react/hooks/internal/useIsomorphicLayoutEffect.d.ts +3 -0
- package/react/hooks/internal/useIsomorphicLayoutEffect.js +9 -0
- package/react/hooks/internal/useIsomorphicLayoutEffect.js.map +1 -0
- package/react/hooks/internal/useRenderGuard.d.ts +2 -0
- package/react/hooks/internal/useRenderGuard.js +42 -0
- package/react/hooks/internal/useRenderGuard.js.map +1 -0
- package/react/hooks/internal/useSuspenseHookCacheKey.d.ts +11 -0
- package/react/hooks/internal/useSuspenseHookCacheKey.js +24 -0
- package/react/hooks/internal/useSuspenseHookCacheKey.js.map +1 -0
- package/react/hooks/internal/validateSuspenseHookOptions.d.ts +3 -0
- package/react/hooks/internal/validateSuspenseHookOptions.js +22 -0
- package/react/hooks/internal/validateSuspenseHookOptions.js.map +1 -0
- package/react/hooks/internal/wrapHook.d.ts +66 -0
- package/react/hooks/internal/wrapHook.js +65 -0
- package/react/hooks/internal/wrapHook.js.map +1 -0
- package/react/hooks/useApolloClient.d.ts +18 -0
- package/react/hooks/useApolloClient.js +25 -0
- package/react/hooks/useApolloClient.js.map +1 -0
- package/react/hooks/useBackgroundQuery.d.ts +975 -0
- package/react/hooks/useBackgroundQuery.js +72 -0
- package/react/hooks/useBackgroundQuery.js.map +1 -0
- package/react/hooks/useFragment.d.ts +162 -0
- package/react/hooks/useFragment.js +54 -0
- package/react/hooks/useFragment.js.map +1 -0
- package/react/hooks/useLazyQuery.d.ts +436 -0
- package/react/hooks/useLazyQuery.js +146 -0
- package/react/hooks/useLazyQuery.js.map +1 -0
- package/react/hooks/useLoadableQuery.d.ts +353 -0
- package/react/hooks/useLoadableQuery.js +88 -0
- package/react/hooks/useLoadableQuery.js.map +1 -0
- package/react/hooks/useMutation.d.ts +316 -0
- package/react/hooks/useMutation.js +159 -0
- package/react/hooks/useMutation.js.map +1 -0
- package/react/hooks/useQuery.d.ts +549 -0
- package/react/hooks/useQuery.js +215 -0
- package/react/hooks/useQuery.js.map +1 -0
- package/react/hooks/useQueryRefHandlers.d.ts +78 -0
- package/react/hooks/useQueryRefHandlers.js +68 -0
- package/react/hooks/useQueryRefHandlers.js.map +1 -0
- package/react/hooks/useReactiveVar.d.ts +22 -0
- package/react/hooks/useReactiveVar.js +35 -0
- package/react/hooks/useReactiveVar.js.map +1 -0
- package/react/hooks/useReadQuery.d.ts +100 -0
- package/react/hooks/useReadQuery.js +70 -0
- package/react/hooks/useReadQuery.js.map +1 -0
- package/react/hooks/useSubscription.d.ts +270 -0
- package/react/hooks/useSubscription.js +222 -0
- package/react/hooks/useSubscription.js.map +1 -0
- package/react/hooks/useSuspenseFragment.d.ts +105 -0
- package/react/hooks/useSuspenseFragment.js +47 -0
- package/react/hooks/useSuspenseFragment.js.map +1 -0
- package/react/hooks/useSuspenseQuery.d.ts +630 -0
- package/react/hooks/useSuspenseQuery.js +118 -0
- package/react/hooks/useSuspenseQuery.js.map +1 -0
- package/react/hooks/useSyncExternalStore.d.ts +4 -0
- package/react/hooks/useSyncExternalStore.js +126 -0
- package/react/hooks/useSyncExternalStore.js.map +1 -0
- package/react/hooks-compiled/constants.d.ts +3 -0
- package/react/hooks-compiled/constants.js +2 -0
- package/react/hooks-compiled/constants.js.map +1 -0
- package/react/hooks-compiled/internal/__use.d.ts +4 -0
- package/react/hooks-compiled/internal/__use.js +22 -0
- package/react/hooks-compiled/internal/__use.js.map +1 -0
- package/react/hooks-compiled/internal/index.d.ts +6 -0
- package/react/hooks-compiled/internal/index.js +7 -0
- package/react/hooks-compiled/internal/index.js.map +1 -0
- package/react/hooks-compiled/internal/useDeepMemo.d.ts +3 -0
- package/react/hooks-compiled/internal/useDeepMemo.js +12 -0
- package/react/hooks-compiled/internal/useDeepMemo.js.map +1 -0
- package/react/hooks-compiled/internal/useIsomorphicLayoutEffect.d.ts +3 -0
- package/react/hooks-compiled/internal/useIsomorphicLayoutEffect.js +9 -0
- package/react/hooks-compiled/internal/useIsomorphicLayoutEffect.js.map +1 -0
- package/react/hooks-compiled/internal/useRenderGuard.d.ts +2 -0
- package/react/hooks-compiled/internal/useRenderGuard.js +42 -0
- package/react/hooks-compiled/internal/useRenderGuard.js.map +1 -0
- package/react/hooks-compiled/internal/useSuspenseHookCacheKey.d.ts +11 -0
- package/react/hooks-compiled/internal/useSuspenseHookCacheKey.js +71 -0
- package/react/hooks-compiled/internal/useSuspenseHookCacheKey.js.map +1 -0
- package/react/hooks-compiled/internal/validateSuspenseHookOptions.d.ts +3 -0
- package/react/hooks-compiled/internal/validateSuspenseHookOptions.js +22 -0
- package/react/hooks-compiled/internal/validateSuspenseHookOptions.js.map +1 -0
- package/react/hooks-compiled/internal/wrapHook.d.ts +66 -0
- package/react/hooks-compiled/internal/wrapHook.js +65 -0
- package/react/hooks-compiled/internal/wrapHook.js.map +1 -0
- package/react/hooks-compiled/useApolloClient.d.ts +18 -0
- package/react/hooks-compiled/useApolloClient.js +36 -0
- package/react/hooks-compiled/useApolloClient.js.map +1 -0
- package/react/hooks-compiled/useBackgroundQuery.d.ts +975 -0
- package/react/hooks-compiled/useBackgroundQuery.js +72 -0
- package/react/hooks-compiled/useBackgroundQuery.js.map +1 -0
- package/react/hooks-compiled/useFragment.d.ts +162 -0
- package/react/hooks-compiled/useFragment.js +125 -0
- package/react/hooks-compiled/useFragment.js.map +1 -0
- package/react/hooks-compiled/useLazyQuery.d.ts +436 -0
- package/react/hooks-compiled/useLazyQuery.js +146 -0
- package/react/hooks-compiled/useLazyQuery.js.map +1 -0
- package/react/hooks-compiled/useLoadableQuery.d.ts +353 -0
- package/react/hooks-compiled/useLoadableQuery.js +241 -0
- package/react/hooks-compiled/useLoadableQuery.js.map +1 -0
- package/react/hooks-compiled/useMutation.d.ts +316 -0
- package/react/hooks-compiled/useMutation.js +254 -0
- package/react/hooks-compiled/useMutation.js.map +1 -0
- package/react/hooks-compiled/useQuery.d.ts +549 -0
- package/react/hooks-compiled/useQuery.js +378 -0
- package/react/hooks-compiled/useQuery.js.map +1 -0
- package/react/hooks-compiled/useQueryRefHandlers.d.ts +78 -0
- package/react/hooks-compiled/useQueryRefHandlers.js +106 -0
- package/react/hooks-compiled/useQueryRefHandlers.js.map +1 -0
- package/react/hooks-compiled/useReactiveVar.d.ts +22 -0
- package/react/hooks-compiled/useReactiveVar.js +35 -0
- package/react/hooks-compiled/useReactiveVar.js.map +1 -0
- package/react/hooks-compiled/useReadQuery.d.ts +100 -0
- package/react/hooks-compiled/useReadQuery.js +135 -0
- package/react/hooks-compiled/useReadQuery.js.map +1 -0
- package/react/hooks-compiled/useSubscription.d.ts +270 -0
- package/react/hooks-compiled/useSubscription.js +366 -0
- package/react/hooks-compiled/useSubscription.js.map +1 -0
- package/react/hooks-compiled/useSuspenseFragment.d.ts +105 -0
- package/react/hooks-compiled/useSuspenseFragment.js +47 -0
- package/react/hooks-compiled/useSuspenseFragment.js.map +1 -0
- package/react/hooks-compiled/useSuspenseQuery.d.ts +630 -0
- package/react/hooks-compiled/useSuspenseQuery.js +136 -0
- package/react/hooks-compiled/useSuspenseQuery.js.map +1 -0
- package/react/hooks-compiled/useSyncExternalStore.d.ts +4 -0
- package/react/hooks-compiled/useSyncExternalStore.js +126 -0
- package/react/hooks-compiled/useSyncExternalStore.js.map +1 -0
- package/react/index.compiled.d.ts +33 -0
- package/react/index.compiled.js +19 -0
- package/react/index.compiled.js.map +1 -0
- package/react/index.d.ts +33 -0
- package/react/index.js +19 -0
- package/react/index.js.map +1 -0
- package/react/index.react-server.d.ts +18 -0
- package/react/index.react-server.js +43 -0
- package/react/index.react-server.js.map +1 -0
- package/react/internal/cache/FragmentReference.d.ts +35 -0
- package/react/internal/cache/FragmentReference.js +112 -0
- package/react/internal/cache/FragmentReference.js.map +1 -0
- package/react/internal/cache/QueryReference.d.ts +112 -0
- package/react/internal/cache/QueryReference.js +305 -0
- package/react/internal/cache/QueryReference.js.map +1 -0
- package/react/internal/cache/SuspenseCache.d.ts +29 -0
- package/react/internal/cache/SuspenseCache.js +40 -0
- package/react/internal/cache/SuspenseCache.js.map +1 -0
- package/react/internal/cache/getSuspenseCache.d.ts +18 -0
- package/react/internal/cache/getSuspenseCache.js +9 -0
- package/react/internal/cache/getSuspenseCache.js.map +1 -0
- package/react/internal/cache/types.d.ts +18 -0
- package/react/internal/cache/types.js +2 -0
- package/react/internal/cache/types.js.map +1 -0
- package/react/internal/compiler-runtime/index.d.ts +8 -0
- package/react/internal/compiler-runtime/index.js +28 -0
- package/react/internal/compiler-runtime/index.js.map +1 -0
- package/react/internal/index.d.ts +10 -0
- package/react/internal/index.js +4 -0
- package/react/internal/index.js.map +1 -0
- package/react/internal/types.d.ts +4 -0
- package/react/internal/types.js +2 -0
- package/react/internal/types.js.map +1 -0
- package/react/query-preloader/createQueryPreloader.d.ts +256 -0
- package/react/query-preloader/createQueryPreloader.js +82 -0
- package/react/query-preloader/createQueryPreloader.js.map +1 -0
- package/react/ssr/getDataFromTree.d.ts +25 -0
- package/react/ssr/getDataFromTree.js +39 -0
- package/react/ssr/getDataFromTree.js.map +1 -0
- package/react/ssr/index.d.ts +4 -0
- package/react/ssr/index.js +4 -0
- package/react/ssr/index.js.map +1 -0
- package/react/ssr/prerenderStatic.d.ts +143 -0
- package/react/ssr/prerenderStatic.js +168 -0
- package/react/ssr/prerenderStatic.js.map +1 -0
- package/react/ssr/renderToStringWithData.d.ts +8 -0
- package/react/ssr/renderToStringWithData.js +15 -0
- package/react/ssr/renderToStringWithData.js.map +1 -0
- package/react/ssr/useSSRQuery.d.ts +6 -0
- package/react/ssr/useSSRQuery.js +69 -0
- package/react/ssr/useSSRQuery.js.map +1 -0
- package/react/types/deprecated.d.ts +75 -0
- package/react/types/deprecated.js +2 -0
- package/react/types/deprecated.js.map +1 -0
- package/react/types/types.documentation.d.ts +533 -0
- package/react/types/types.documentation.js +2 -0
- package/react/types/types.documentation.js.map +1 -0
- package/testing/core/mocking/mockLink.d.ts +66 -0
- package/testing/core/mocking/mockLink.js +187 -0
- package/testing/core/mocking/mockLink.js.map +1 -0
- package/testing/core/mocking/mockSubscriptionLink.d.ts +22 -0
- package/testing/core/mocking/mockSubscriptionLink.js +52 -0
- package/testing/core/mocking/mockSubscriptionLink.js.map +1 -0
- package/testing/core/types/deprecated.d.ts +11 -0
- package/testing/core/types/deprecated.js +2 -0
- package/testing/core/types/deprecated.js.map +1 -0
- package/testing/index.d.ts +4 -0
- package/testing/index.js +3 -0
- package/testing/index.js.map +1 -0
- package/testing/react/MockedProvider.d.ts +33 -0
- package/testing/react/MockedProvider.js +38 -0
- package/testing/react/MockedProvider.js.map +1 -0
- package/testing/react/index.d.ts +3 -0
- package/testing/react/index.js +2 -0
- package/testing/react/index.js.map +1 -0
- package/utilities/DeepPartial.d.ts +15 -0
- package/utilities/DeepPartial.js +6 -0
- package/utilities/DeepPartial.js.map +1 -0
- package/utilities/HKT.d.ts +36 -0
- package/utilities/HKT.js +2 -0
- package/utilities/HKT.js.map +1 -0
- package/utilities/caching/index.d.ts +3 -0
- package/utilities/caching/index.js +2 -0
- package/utilities/caching/index.js.map +1 -0
- package/utilities/caching/sizes.d.ts +286 -0
- package/utilities/caching/sizes.js +26 -0
- package/utilities/caching/sizes.js.map +1 -0
- package/utilities/common/stripTypename.d.ts +19 -0
- package/utilities/common/stripTypename.js +22 -0
- package/utilities/common/stripTypename.js.map +1 -0
- package/utilities/environment/index.d.ts +2 -0
- package/utilities/environment/index.development.d.ts +2 -0
- package/utilities/environment/index.development.js +2 -0
- package/utilities/environment/index.development.js.map +1 -0
- package/utilities/environment/index.js +2 -0
- package/utilities/environment/index.js.map +1 -0
- package/utilities/environment/index.production.d.ts +2 -0
- package/utilities/environment/index.production.js +2 -0
- package/utilities/environment/index.production.js.map +1 -0
- package/utilities/graphql/DocumentTransform.d.ts +143 -0
- package/utilities/graphql/DocumentTransform.js +186 -0
- package/utilities/graphql/DocumentTransform.js.map +1 -0
- package/utilities/graphql/isFormattedExecutionResult.d.ts +30 -0
- package/utilities/graphql/isFormattedExecutionResult.js +33 -0
- package/utilities/graphql/isFormattedExecutionResult.js.map +1 -0
- package/utilities/graphql/operations.d.ts +77 -0
- package/utilities/graphql/operations.js +86 -0
- package/utilities/graphql/operations.js.map +1 -0
- package/utilities/graphql/print.d.ts +13 -0
- package/utilities/graphql/print.js +30 -0
- package/utilities/graphql/print.js.map +1 -0
- package/utilities/graphql/storeUtils.d.ts +52 -0
- package/utilities/graphql/storeUtils.js +18 -0
- package/utilities/graphql/storeUtils.js.map +1 -0
- package/utilities/graphql/transform.d.ts +21 -0
- package/utilities/graphql/transform.js +71 -0
- package/utilities/graphql/transform.js.map +1 -0
- package/utilities/index.d.ts +19 -0
- package/utilities/index.js +14 -0
- package/utilities/index.js.map +1 -0
- package/utilities/internal/DeepMerger.d.ts +33 -0
- package/utilities/internal/DeepMerger.js +95 -0
- package/utilities/internal/DeepMerger.js.map +1 -0
- package/utilities/internal/argumentsObjectFromField.d.ts +8 -0
- package/utilities/internal/argumentsObjectFromField.js +15 -0
- package/utilities/internal/argumentsObjectFromField.js.map +1 -0
- package/utilities/internal/bindCacheKey.d.ts +15 -0
- package/utilities/internal/bindCacheKey.js +18 -0
- package/utilities/internal/bindCacheKey.js.map +1 -0
- package/utilities/internal/caches.d.ts +42 -0
- package/utilities/internal/caches.js +73 -0
- package/utilities/internal/caches.js.map +1 -0
- package/utilities/internal/canUseDOM.d.ts +7 -0
- package/utilities/internal/canUseDOM.js +8 -0
- package/utilities/internal/canUseDOM.js.map +1 -0
- package/utilities/internal/canonicalStringify.d.ts +44 -0
- package/utilities/internal/canonicalStringify.js +109 -0
- package/utilities/internal/canonicalStringify.js.map +1 -0
- package/utilities/internal/checkDocument.d.ts +10 -0
- package/utilities/internal/checkDocument.js +64 -0
- package/utilities/internal/checkDocument.js.map +1 -0
- package/utilities/internal/cloneDeep.d.ts +9 -0
- package/utilities/internal/cloneDeep.js +42 -0
- package/utilities/internal/cloneDeep.js.map +1 -0
- package/utilities/internal/combineLatestBatched.d.ts +14 -0
- package/utilities/internal/combineLatestBatched.js +68 -0
- package/utilities/internal/combineLatestBatched.js.map +1 -0
- package/utilities/internal/compact.d.ts +11 -0
- package/utilities/internal/compact.js +23 -0
- package/utilities/internal/compact.js.map +1 -0
- package/utilities/internal/constants.d.ts +23 -0
- package/utilities/internal/constants.js +23 -0
- package/utilities/internal/constants.js.map +1 -0
- package/utilities/internal/createFragmentMap.d.ts +12 -0
- package/utilities/internal/createFragmentMap.js +16 -0
- package/utilities/internal/createFragmentMap.js.map +1 -0
- package/utilities/internal/createFulfilledPromise.d.ts +8 -0
- package/utilities/internal/createFulfilledPromise.js +12 -0
- package/utilities/internal/createFulfilledPromise.js.map +1 -0
- package/utilities/internal/createRejectedPromise.d.ts +8 -0
- package/utilities/internal/createRejectedPromise.js +14 -0
- package/utilities/internal/createRejectedPromise.js.map +1 -0
- package/utilities/internal/dealias.d.ts +5 -0
- package/utilities/internal/dealias.js +18 -0
- package/utilities/internal/dealias.js.map +1 -0
- package/utilities/internal/decoratePromise.d.ts +8 -0
- package/utilities/internal/decoratePromise.js +30 -0
- package/utilities/internal/decoratePromise.js.map +1 -0
- package/utilities/internal/deepFreeze.d.ts +7 -0
- package/utilities/internal/deepFreeze.js +36 -0
- package/utilities/internal/deepFreeze.js.map +1 -0
- package/utilities/internal/equalByQuery.d.ts +5 -0
- package/utilities/internal/equalByQuery.js +90 -0
- package/utilities/internal/equalByQuery.js.map +1 -0
- package/utilities/internal/filterMap.d.ts +4 -0
- package/utilities/internal/filterMap.js +28 -0
- package/utilities/internal/filterMap.js.map +1 -0
- package/utilities/internal/getDefaultValues.d.ts +8 -0
- package/utilities/internal/getDefaultValues.js +19 -0
- package/utilities/internal/getDefaultValues.js.map +1 -0
- package/utilities/internal/getFragmentDefinition.d.ts +8 -0
- package/utilities/internal/getFragmentDefinition.js +14 -0
- package/utilities/internal/getFragmentDefinition.js.map +1 -0
- package/utilities/internal/getFragmentDefinitions.d.ts +8 -0
- package/utilities/internal/getFragmentDefinitions.js +9 -0
- package/utilities/internal/getFragmentDefinitions.js.map +1 -0
- package/utilities/internal/getFragmentFromSelection.d.ts +10 -0
- package/utilities/internal/getFragmentFromSelection.js +24 -0
- package/utilities/internal/getFragmentFromSelection.js.map +1 -0
- package/utilities/internal/getFragmentQueryDocument.d.ts +39 -0
- package/utilities/internal/getFragmentQueryDocument.js +93 -0
- package/utilities/internal/getFragmentQueryDocument.js.map +1 -0
- package/utilities/internal/getGraphQLErrorsFromResult.d.ts +10 -0
- package/utilities/internal/getGraphQLErrorsFromResult.js +9 -0
- package/utilities/internal/getGraphQLErrorsFromResult.js.map +1 -0
- package/utilities/internal/getMainDefinition.d.ts +40 -0
- package/utilities/internal/getMainDefinition.js +58 -0
- package/utilities/internal/getMainDefinition.js.map +1 -0
- package/utilities/internal/getMemoryInternals.d.ts +80 -0
- package/utilities/internal/getMemoryInternals.js +128 -0
- package/utilities/internal/getMemoryInternals.js.map +1 -0
- package/utilities/internal/getOperationDefinition.d.ts +8 -0
- package/utilities/internal/getOperationDefinition.js +11 -0
- package/utilities/internal/getOperationDefinition.js.map +1 -0
- package/utilities/internal/getOperationName.d.ts +8 -0
- package/utilities/internal/getOperationName.js +9 -0
- package/utilities/internal/getOperationName.js.map +1 -0
- package/utilities/internal/getQueryDefinition.d.ts +8 -0
- package/utilities/internal/getQueryDefinition.js +13 -0
- package/utilities/internal/getQueryDefinition.js.map +1 -0
- package/utilities/internal/getStoreKeyName.d.ts +16 -0
- package/utilities/internal/getStoreKeyName.js +73 -0
- package/utilities/internal/getStoreKeyName.js.map +1 -0
- package/utilities/internal/globals/global.d.ts +3 -0
- package/utilities/internal/globals/global.js +14 -0
- package/utilities/internal/globals/global.js.map +1 -0
- package/utilities/internal/globals/index.d.ts +3 -0
- package/utilities/internal/globals/index.js +3 -0
- package/utilities/internal/globals/index.js.map +1 -0
- package/utilities/internal/globals/maybe.d.ts +2 -0
- package/utilities/internal/globals/maybe.js +7 -0
- package/utilities/internal/globals/maybe.js.map +1 -0
- package/utilities/internal/graphQLResultHasError.d.ts +8 -0
- package/utilities/internal/graphQLResultHasError.js +9 -0
- package/utilities/internal/graphQLResultHasError.js.map +1 -0
- package/utilities/internal/hasDirectives.d.ts +8 -0
- package/utilities/internal/hasDirectives.js +21 -0
- package/utilities/internal/hasDirectives.js.map +1 -0
- package/utilities/internal/hasForcedResolvers.d.ts +3 -0
- package/utilities/internal/hasForcedResolvers.js +20 -0
- package/utilities/internal/hasForcedResolvers.js.map +1 -0
- package/utilities/internal/index.d.ts +74 -0
- package/utilities/internal/index.js +56 -0
- package/utilities/internal/index.js.map +1 -0
- package/utilities/internal/index.production.d.ts +3 -0
- package/utilities/internal/index.production.js +7 -0
- package/utilities/internal/index.production.js.map +1 -0
- package/utilities/internal/isArray.d.ts +9 -0
- package/utilities/internal/isArray.js +9 -0
- package/utilities/internal/isArray.js.map +1 -0
- package/utilities/internal/isDocumentNode.d.ts +8 -0
- package/utilities/internal/isDocumentNode.js +12 -0
- package/utilities/internal/isDocumentNode.js.map +1 -0
- package/utilities/internal/isField.d.ts +8 -0
- package/utilities/internal/isField.js +9 -0
- package/utilities/internal/isField.js.map +1 -0
- package/utilities/internal/isNonEmptyArray.d.ts +7 -0
- package/utilities/internal/isNonEmptyArray.js +9 -0
- package/utilities/internal/isNonEmptyArray.js.map +1 -0
- package/utilities/internal/isNonNullObject.d.ts +7 -0
- package/utilities/internal/isNonNullObject.js +9 -0
- package/utilities/internal/isNonNullObject.js.map +1 -0
- package/utilities/internal/isPlainObject.d.ts +7 -0
- package/utilities/internal/isPlainObject.js +12 -0
- package/utilities/internal/isPlainObject.js.map +1 -0
- package/utilities/internal/makeReference.d.ts +8 -0
- package/utilities/internal/makeReference.js +9 -0
- package/utilities/internal/makeReference.js.map +1 -0
- package/utilities/internal/makeUniqueId.d.ts +10 -0
- package/utilities/internal/makeUniqueId.js +15 -0
- package/utilities/internal/makeUniqueId.js.map +1 -0
- package/utilities/internal/mapObservableFragment.d.ts +3 -0
- package/utilities/internal/mapObservableFragment.js +24 -0
- package/utilities/internal/mapObservableFragment.js.map +1 -0
- package/utilities/internal/maybeDeepFreeze.d.ts +7 -0
- package/utilities/internal/maybeDeepFreeze.js +14 -0
- package/utilities/internal/maybeDeepFreeze.js.map +1 -0
- package/utilities/internal/memoize.d.ts +8 -0
- package/utilities/internal/memoize.js +28 -0
- package/utilities/internal/memoize.js.map +1 -0
- package/utilities/internal/mergeDeep.d.ts +8 -0
- package/utilities/internal/mergeDeep.js +23 -0
- package/utilities/internal/mergeDeep.js.map +1 -0
- package/utilities/internal/mergeDeepArray.d.ts +7 -0
- package/utilities/internal/mergeDeepArray.js +24 -0
- package/utilities/internal/mergeDeepArray.js.map +1 -0
- package/utilities/internal/mergeOptions.d.ts +10 -0
- package/utilities/internal/mergeOptions.js +15 -0
- package/utilities/internal/mergeOptions.js.map +1 -0
- package/utilities/internal/omitDeep.d.ts +8 -0
- package/utilities/internal/omitDeep.js +45 -0
- package/utilities/internal/omitDeep.js.map +1 -0
- package/utilities/internal/ponyfills/FinalizationRegistry.d.ts +11 -0
- package/utilities/internal/ponyfills/FinalizationRegistry.js +57 -0
- package/utilities/internal/ponyfills/FinalizationRegistry.js.map +1 -0
- package/utilities/internal/ponyfills/index.d.ts +3 -0
- package/utilities/internal/ponyfills/index.js +3 -0
- package/utilities/internal/ponyfills/index.js.map +1 -0
- package/utilities/internal/ponyfills/index.react-native.d.ts +2 -0
- package/utilities/internal/ponyfills/index.react-native.js +2 -0
- package/utilities/internal/ponyfills/index.react-native.js.map +1 -0
- package/utilities/internal/preventUnhandledRejection.d.ts +2 -0
- package/utilities/internal/preventUnhandledRejection.js +5 -0
- package/utilities/internal/preventUnhandledRejection.js.map +1 -0
- package/utilities/internal/removeDirectivesFromDocument.d.ts +14 -0
- package/utilities/internal/removeDirectivesFromDocument.js +299 -0
- package/utilities/internal/removeDirectivesFromDocument.js.map +1 -0
- package/utilities/internal/removeFragmentSpreads.d.ts +3 -0
- package/utilities/internal/removeFragmentSpreads.js +11 -0
- package/utilities/internal/removeFragmentSpreads.js.map +1 -0
- package/utilities/internal/resultKeyNameFromField.d.ts +8 -0
- package/utilities/internal/resultKeyNameFromField.js +9 -0
- package/utilities/internal/resultKeyNameFromField.js.map +1 -0
- package/utilities/internal/shouldInclude.d.ts +8 -0
- package/utilities/internal/shouldInclude.js +47 -0
- package/utilities/internal/shouldInclude.js.map +1 -0
- package/utilities/internal/storeKeyNameFromField.d.ts +8 -0
- package/utilities/internal/storeKeyNameFromField.js +26 -0
- package/utilities/internal/storeKeyNameFromField.js.map +1 -0
- package/utilities/internal/stringifyForDisplay.d.ts +7 -0
- package/utilities/internal/stringifyForDisplay.js +15 -0
- package/utilities/internal/stringifyForDisplay.js.map +1 -0
- package/utilities/internal/toQueryResult.d.ts +8 -0
- package/utilities/internal/toQueryResult.js +15 -0
- package/utilities/internal/toQueryResult.js.map +1 -0
- package/utilities/internal/types/ApplyHKT.d.ts +13 -0
- package/utilities/internal/types/ApplyHKT.js +2 -0
- package/utilities/internal/types/ApplyHKT.js.map +1 -0
- package/utilities/internal/types/ApplyHKTImplementationWithDefault.d.ts +11 -0
- package/utilities/internal/types/ApplyHKTImplementationWithDefault.js +2 -0
- package/utilities/internal/types/ApplyHKTImplementationWithDefault.js.map +1 -0
- package/utilities/internal/types/DecoratedPromise.d.ts +10 -0
- package/utilities/internal/types/DecoratedPromise.js +2 -0
- package/utilities/internal/types/DecoratedPromise.js.map +1 -0
- package/utilities/internal/types/DeepOmit.d.ts +15 -0
- package/utilities/internal/types/DeepOmit.js +2 -0
- package/utilities/internal/types/DeepOmit.js.map +1 -0
- package/utilities/internal/types/DocumentationTypes.d.ts +88 -0
- package/utilities/internal/types/DocumentationTypes.js +2 -0
- package/utilities/internal/types/DocumentationTypes.js.map +1 -0
- package/utilities/internal/types/ExtensionsWithStreamDetails.d.ts +12 -0
- package/utilities/internal/types/ExtensionsWithStreamDetails.js +2 -0
- package/utilities/internal/types/ExtensionsWithStreamDetails.js.map +1 -0
- package/utilities/internal/types/FragmentMap.d.ts +12 -0
- package/utilities/internal/types/FragmentMap.js +2 -0
- package/utilities/internal/types/FragmentMap.js.map +1 -0
- package/utilities/internal/types/FragmentMapFunction.d.ts +8 -0
- package/utilities/internal/types/FragmentMapFunction.js +2 -0
- package/utilities/internal/types/FragmentMapFunction.js.map +1 -0
- package/utilities/internal/types/FulfilledPromise.d.ts +10 -0
- package/utilities/internal/types/FulfilledPromise.js +2 -0
- package/utilities/internal/types/FulfilledPromise.js.map +1 -0
- package/utilities/internal/types/IsAny.d.ts +7 -0
- package/utilities/internal/types/IsAny.js +2 -0
- package/utilities/internal/types/IsAny.js.map +1 -0
- package/utilities/internal/types/NoInfer.d.ts +35 -0
- package/utilities/internal/types/NoInfer.js +2 -0
- package/utilities/internal/types/NoInfer.js.map +1 -0
- package/utilities/internal/types/PendingPromise.d.ts +9 -0
- package/utilities/internal/types/PendingPromise.js +2 -0
- package/utilities/internal/types/PendingPromise.js.map +1 -0
- package/utilities/internal/types/Prettify.d.ts +9 -0
- package/utilities/internal/types/Prettify.js +2 -0
- package/utilities/internal/types/Prettify.js.map +1 -0
- package/utilities/internal/types/Primitive.d.ts +7 -0
- package/utilities/internal/types/Primitive.js +2 -0
- package/utilities/internal/types/Primitive.js.map +1 -0
- package/utilities/internal/types/RejectedPromise.d.ts +10 -0
- package/utilities/internal/types/RejectedPromise.js +2 -0
- package/utilities/internal/types/RejectedPromise.js.map +1 -0
- package/utilities/internal/types/RemoveIndexSignature.d.ts +9 -0
- package/utilities/internal/types/RemoveIndexSignature.js +2 -0
- package/utilities/internal/types/RemoveIndexSignature.js.map +1 -0
- package/utilities/internal/types/StreamInfoTrie.d.ts +16 -0
- package/utilities/internal/types/StreamInfoTrie.js +2 -0
- package/utilities/internal/types/StreamInfoTrie.js.map +1 -0
- package/utilities/internal/types/TupleToIntersection.d.ts +2 -0
- package/utilities/internal/types/TupleToIntersection.js +2 -0
- package/utilities/internal/types/TupleToIntersection.js.map +1 -0
- package/utilities/internal/types/VariablesOption.d.ts +26 -0
- package/utilities/internal/types/VariablesOption.js +2 -0
- package/utilities/internal/types/VariablesOption.js.map +1 -0
- package/utilities/internal/valueToObjectRepresentation.d.ts +8 -0
- package/utilities/internal/valueToObjectRepresentation.js +41 -0
- package/utilities/internal/valueToObjectRepresentation.js.map +1 -0
- package/utilities/invariant/index.d.ts +47 -0
- package/utilities/invariant/index.development.d.ts +4 -0
- package/utilities/invariant/index.development.js +12 -0
- package/utilities/invariant/index.development.js.map +1 -0
- package/utilities/invariant/index.js +93 -0
- package/utilities/invariant/index.js.map +1 -0
- package/utilities/isNetworkRequestInFlight.d.ts +7 -0
- package/utilities/isNetworkRequestInFlight.js +9 -0
- package/utilities/isNetworkRequestInFlight.js.map +1 -0
- package/utilities/isNetworkRequestSettled.d.ts +7 -0
- package/utilities/isNetworkRequestSettled.js +8 -0
- package/utilities/isNetworkRequestSettled.js.map +1 -0
- package/utilities/policies/pagination.d.ts +51 -0
- package/utilities/policies/pagination.js +233 -0
- package/utilities/policies/pagination.js.map +1 -0
- package/utilities/subscriptions/relay/index.d.ts +10 -0
- package/utilities/subscriptions/relay/index.js +59 -0
- package/utilities/subscriptions/relay/index.js.map +1 -0
- package/v4-migration.d.ts +826 -0
- package/v4-migration.js +8 -0
- package/v4-migration.js.map +1 -0
- package/version.d.ts +3 -0
- package/version.js +3 -0
- package/version.js.map +1 -0
|
@@ -0,0 +1,1413 @@
|
|
|
1
|
+
"use strict";;
|
|
2
|
+
const {
|
|
3
|
+
__DEV__
|
|
4
|
+
} = require("@apollo/client/utilities/environment");
|
|
5
|
+
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.ObservableQuery = void 0;
|
|
8
|
+
exports.logMissingFieldErrors = logMissingFieldErrors;
|
|
9
|
+
const equality_1 = require("@wry/equality");
|
|
10
|
+
const rxjs_1 = require("rxjs");
|
|
11
|
+
const utilities_1 = require("@apollo/client/utilities");
|
|
12
|
+
const environment_1 = require("@apollo/client/utilities/environment");
|
|
13
|
+
const internal_1 = require("@apollo/client/utilities/internal");
|
|
14
|
+
const invariant_1 = require("@apollo/client/utilities/invariant");
|
|
15
|
+
const networkStatus_js_1 = require("./networkStatus.cjs");
|
|
16
|
+
const { assign, hasOwnProperty } = Object;
|
|
17
|
+
const uninitialized = {
|
|
18
|
+
loading: true,
|
|
19
|
+
networkStatus: networkStatus_js_1.NetworkStatus.loading,
|
|
20
|
+
data: undefined,
|
|
21
|
+
dataState: "empty",
|
|
22
|
+
partial: true,
|
|
23
|
+
};
|
|
24
|
+
const empty = {
|
|
25
|
+
loading: false,
|
|
26
|
+
networkStatus: networkStatus_js_1.NetworkStatus.ready,
|
|
27
|
+
data: undefined,
|
|
28
|
+
dataState: "empty",
|
|
29
|
+
partial: true,
|
|
30
|
+
};
|
|
31
|
+
class ObservableQuery {
|
|
32
|
+
options;
|
|
33
|
+
queryName;
|
|
34
|
+
variablesUnknown = false;
|
|
35
|
+
/**
|
|
36
|
+
* @internal will be read and written from `QueryInfo`
|
|
37
|
+
*
|
|
38
|
+
* @deprecated This is an internal API and should not be used directly. This can be removed or changed at any time.
|
|
39
|
+
*/
|
|
40
|
+
_lastWrite;
|
|
41
|
+
// The `query` computed property will always reflect the document transformed
|
|
42
|
+
// by the last run query. `this.options.query` will always reflect the raw
|
|
43
|
+
// untransformed query to ensure document transforms with runtime conditionals
|
|
44
|
+
// are run on the original document.
|
|
45
|
+
get query() {
|
|
46
|
+
return this.lastQuery;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* An object containing the variables that were provided for the query.
|
|
50
|
+
*/
|
|
51
|
+
get variables() {
|
|
52
|
+
return this.options.variables;
|
|
53
|
+
}
|
|
54
|
+
unsubscribeFromCache;
|
|
55
|
+
input;
|
|
56
|
+
subject;
|
|
57
|
+
isTornDown;
|
|
58
|
+
queryManager;
|
|
59
|
+
subscriptions = new Set();
|
|
60
|
+
/**
|
|
61
|
+
* If an `ObservableQuery` is created with a `network-only` fetch policy,
|
|
62
|
+
* it should actually start receiving cache updates, but not before it has
|
|
63
|
+
* received the first result from the network.
|
|
64
|
+
*/
|
|
65
|
+
waitForNetworkResult;
|
|
66
|
+
lastQuery;
|
|
67
|
+
linkSubscription;
|
|
68
|
+
pollingInfo;
|
|
69
|
+
get networkStatus() {
|
|
70
|
+
return this.subject.getValue().result.networkStatus;
|
|
71
|
+
}
|
|
72
|
+
get cache() {
|
|
73
|
+
return this.queryManager.cache;
|
|
74
|
+
}
|
|
75
|
+
constructor({ queryManager, options, transformedQuery = queryManager.transform(options.query), }) {
|
|
76
|
+
this.queryManager = queryManager;
|
|
77
|
+
// active state
|
|
78
|
+
this.waitForNetworkResult = options.fetchPolicy === "network-only";
|
|
79
|
+
this.isTornDown = false;
|
|
80
|
+
this.subscribeToMore = this.subscribeToMore.bind(this);
|
|
81
|
+
this.maskResult = this.maskResult.bind(this);
|
|
82
|
+
const { watchQuery: { fetchPolicy: defaultFetchPolicy = "cache-first" } = {}, } = queryManager.defaultOptions;
|
|
83
|
+
const { fetchPolicy = defaultFetchPolicy,
|
|
84
|
+
// Make sure we don't store "standby" as the initialFetchPolicy.
|
|
85
|
+
initialFetchPolicy = fetchPolicy === "standby" ? defaultFetchPolicy : (fetchPolicy), } = options;
|
|
86
|
+
if (options[internal_1.variablesUnknownSymbol]) {
|
|
87
|
+
(0, invariant_1.invariant)(fetchPolicy === "standby", 80);
|
|
88
|
+
this.variablesUnknown = true;
|
|
89
|
+
}
|
|
90
|
+
this.lastQuery = transformedQuery;
|
|
91
|
+
this.options = {
|
|
92
|
+
...options,
|
|
93
|
+
// Remember the initial options.fetchPolicy so we can revert back to this
|
|
94
|
+
// policy when variables change. This information can also be specified
|
|
95
|
+
// (or overridden) by providing options.initialFetchPolicy explicitly.
|
|
96
|
+
initialFetchPolicy,
|
|
97
|
+
// This ensures this.options.fetchPolicy always has a string value, in
|
|
98
|
+
// case options.fetchPolicy was not provided.
|
|
99
|
+
fetchPolicy,
|
|
100
|
+
variables: this.getVariablesWithDefaults(options.variables),
|
|
101
|
+
};
|
|
102
|
+
this.initializeObservablesQueue();
|
|
103
|
+
this["@@observable"] = () => this;
|
|
104
|
+
if (Symbol.observable) {
|
|
105
|
+
this[Symbol.observable] = () => this;
|
|
106
|
+
}
|
|
107
|
+
const opDef = (0, internal_1.getOperationDefinition)(this.query);
|
|
108
|
+
this.queryName = opDef && opDef.name && opDef.name.value;
|
|
109
|
+
}
|
|
110
|
+
initializeObservablesQueue() {
|
|
111
|
+
this.subject = new rxjs_1.BehaviorSubject({
|
|
112
|
+
query: this.query,
|
|
113
|
+
variables: this.variables,
|
|
114
|
+
result: uninitialized,
|
|
115
|
+
meta: {},
|
|
116
|
+
});
|
|
117
|
+
const observable = this.subject.pipe((0, rxjs_1.tap)({
|
|
118
|
+
subscribe: () => {
|
|
119
|
+
if (!this.subject.observed) {
|
|
120
|
+
this.reobserve();
|
|
121
|
+
// TODO: See if we can rework updatePolling to better handle this.
|
|
122
|
+
// reobserve calls updatePolling but this `subscribe` callback is
|
|
123
|
+
// called before the subject is subscribed to so `updatePolling`
|
|
124
|
+
// can't accurately detect if there is an active subscription.
|
|
125
|
+
// Calling it again here ensures that it can detect if it can poll
|
|
126
|
+
setTimeout(() => this.updatePolling());
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
unsubscribe: () => {
|
|
130
|
+
if (!this.subject.observed) {
|
|
131
|
+
this.tearDownQuery();
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
}), (0, internal_1.filterMap)(({ query, variables, result: current, meta }, context) => {
|
|
135
|
+
const { shouldEmit } = meta;
|
|
136
|
+
if (current === uninitialized) {
|
|
137
|
+
// reset internal state after `ObservableQuery.reset()`
|
|
138
|
+
context.previous = undefined;
|
|
139
|
+
context.previousVariables = undefined;
|
|
140
|
+
}
|
|
141
|
+
if (this.options.fetchPolicy === "standby" ||
|
|
142
|
+
shouldEmit === 2 /* EmitBehavior.never */)
|
|
143
|
+
return;
|
|
144
|
+
if (shouldEmit === 1 /* EmitBehavior.force */)
|
|
145
|
+
return emit();
|
|
146
|
+
const { previous, previousVariables } = context;
|
|
147
|
+
if (previous) {
|
|
148
|
+
const documentInfo = this.queryManager.getDocumentInfo(query);
|
|
149
|
+
const dataMasking = this.queryManager.dataMasking;
|
|
150
|
+
const maskedQuery = dataMasking ? documentInfo.nonReactiveQuery : query;
|
|
151
|
+
const resultIsEqual = dataMasking || documentInfo.hasNonreactiveDirective ?
|
|
152
|
+
(0, internal_1.equalByQuery)(maskedQuery, previous, current, variables)
|
|
153
|
+
: (0, equality_1.equal)(previous, current);
|
|
154
|
+
if (resultIsEqual && (0, equality_1.equal)(previousVariables, variables)) {
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
if (shouldEmit === 3 /* EmitBehavior.networkStatusChange */ &&
|
|
159
|
+
(!this.options.notifyOnNetworkStatusChange ||
|
|
160
|
+
(0, equality_1.equal)(previous, current))) {
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
return emit();
|
|
164
|
+
function emit() {
|
|
165
|
+
context.previous = current;
|
|
166
|
+
context.previousVariables = variables;
|
|
167
|
+
return current;
|
|
168
|
+
}
|
|
169
|
+
}, () => ({})));
|
|
170
|
+
this.pipe = observable.pipe.bind(observable);
|
|
171
|
+
this.subscribe = observable.subscribe.bind(observable);
|
|
172
|
+
this.input = new rxjs_1.Subject();
|
|
173
|
+
// we want to feed many streams into `this.subject`, but none of them should
|
|
174
|
+
// be able to close `this.input`
|
|
175
|
+
this.input.complete = () => { };
|
|
176
|
+
this.input.pipe(this.operator).subscribe(this.subject);
|
|
177
|
+
}
|
|
178
|
+
// We can't use Observable['subscribe'] here as the type as it conflicts with
|
|
179
|
+
// the ability to infer T from Subscribable<T>. This limits the surface area
|
|
180
|
+
// to the non-deprecated signature which works properly with type inference.
|
|
181
|
+
/**
|
|
182
|
+
* Subscribes to the `ObservableQuery`.
|
|
183
|
+
* @param observerOrNext - Either an RxJS `Observer` with some or all callback methods,
|
|
184
|
+
* or the `next` handler that is called for each value emitted from the subscribed Observable.
|
|
185
|
+
* @returns A subscription reference to the registered handlers.
|
|
186
|
+
*/
|
|
187
|
+
subscribe;
|
|
188
|
+
/**
|
|
189
|
+
* Used to stitch together functional operators into a chain.
|
|
190
|
+
*
|
|
191
|
+
* @example
|
|
192
|
+
*
|
|
193
|
+
* ```ts
|
|
194
|
+
* import { filter, map } from 'rxjs';
|
|
195
|
+
*
|
|
196
|
+
* observableQuery
|
|
197
|
+
* .pipe(
|
|
198
|
+
* filter(...),
|
|
199
|
+
* map(...),
|
|
200
|
+
* )
|
|
201
|
+
* .subscribe(x => console.log(x));
|
|
202
|
+
* ```
|
|
203
|
+
*
|
|
204
|
+
* @returns The Observable result of all the operators having been called
|
|
205
|
+
* in the order they were passed in.
|
|
206
|
+
*/
|
|
207
|
+
pipe;
|
|
208
|
+
[Symbol.observable];
|
|
209
|
+
["@@observable"];
|
|
210
|
+
/**
|
|
211
|
+
* @internal
|
|
212
|
+
*
|
|
213
|
+
* @deprecated This is an internal API and should not be used directly. This can be removed or changed at any time.
|
|
214
|
+
*/
|
|
215
|
+
getCacheDiff({ optimistic = true } = {}) {
|
|
216
|
+
return this.cache.diff({
|
|
217
|
+
query: this.query,
|
|
218
|
+
variables: this.variables,
|
|
219
|
+
returnPartialData: true,
|
|
220
|
+
optimistic,
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
getInitialResult(initialFetchPolicy) {
|
|
224
|
+
let fetchPolicy = initialFetchPolicy || this.options.fetchPolicy;
|
|
225
|
+
if (this.queryManager.prioritizeCacheValues &&
|
|
226
|
+
(fetchPolicy === "network-only" || fetchPolicy === "cache-and-network")) {
|
|
227
|
+
fetchPolicy = "cache-first";
|
|
228
|
+
}
|
|
229
|
+
const cacheResult = () => {
|
|
230
|
+
const diff = this.getCacheDiff();
|
|
231
|
+
// TODO: queryInfo.getDiff should handle this since cache.diff returns a
|
|
232
|
+
// null when returnPartialData is false
|
|
233
|
+
const data = this.options.returnPartialData || diff.complete ?
|
|
234
|
+
diff.result ?? undefined
|
|
235
|
+
: undefined;
|
|
236
|
+
return this.maskResult({
|
|
237
|
+
data,
|
|
238
|
+
dataState: diff.complete ? "complete"
|
|
239
|
+
: data === undefined ? "empty"
|
|
240
|
+
: "partial",
|
|
241
|
+
loading: !diff.complete,
|
|
242
|
+
networkStatus: diff.complete ? networkStatus_js_1.NetworkStatus.ready : networkStatus_js_1.NetworkStatus.loading,
|
|
243
|
+
partial: !diff.complete,
|
|
244
|
+
});
|
|
245
|
+
};
|
|
246
|
+
switch (fetchPolicy) {
|
|
247
|
+
case "cache-only": {
|
|
248
|
+
return {
|
|
249
|
+
...cacheResult(),
|
|
250
|
+
loading: false,
|
|
251
|
+
networkStatus: networkStatus_js_1.NetworkStatus.ready,
|
|
252
|
+
};
|
|
253
|
+
}
|
|
254
|
+
case "cache-first":
|
|
255
|
+
return cacheResult();
|
|
256
|
+
case "cache-and-network":
|
|
257
|
+
return {
|
|
258
|
+
...cacheResult(),
|
|
259
|
+
loading: true,
|
|
260
|
+
networkStatus: networkStatus_js_1.NetworkStatus.loading,
|
|
261
|
+
};
|
|
262
|
+
case "standby":
|
|
263
|
+
return empty;
|
|
264
|
+
default:
|
|
265
|
+
return uninitialized;
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
resubscribeCache() {
|
|
269
|
+
const { variables, fetchPolicy } = this.options;
|
|
270
|
+
const query = this.query;
|
|
271
|
+
const shouldUnsubscribe = fetchPolicy === "standby" ||
|
|
272
|
+
fetchPolicy === "no-cache" ||
|
|
273
|
+
this.waitForNetworkResult;
|
|
274
|
+
const shouldResubscribe = !isEqualQuery({ query, variables }, this.unsubscribeFromCache) &&
|
|
275
|
+
!this.waitForNetworkResult;
|
|
276
|
+
if (shouldUnsubscribe || shouldResubscribe) {
|
|
277
|
+
this.unsubscribeFromCache?.();
|
|
278
|
+
}
|
|
279
|
+
if (shouldUnsubscribe || !shouldResubscribe) {
|
|
280
|
+
return;
|
|
281
|
+
}
|
|
282
|
+
const watch = {
|
|
283
|
+
query,
|
|
284
|
+
variables,
|
|
285
|
+
optimistic: true,
|
|
286
|
+
watcher: this,
|
|
287
|
+
callback: (diff) => {
|
|
288
|
+
const info = this.queryManager.getDocumentInfo(query);
|
|
289
|
+
if (info.hasClientExports || info.hasForcedResolvers) {
|
|
290
|
+
// If this is not set to something different than `diff`, we will
|
|
291
|
+
// not be notified about future cache changes with an equal `diff`.
|
|
292
|
+
// That would be the case if we are working with client-only fields
|
|
293
|
+
// that are forced or with `exports` fields that might change, causing
|
|
294
|
+
// local resolvers to return a new result.
|
|
295
|
+
// This is based on an implementation detail of `InMemoryCache`, which
|
|
296
|
+
// is not optimal - but the only alternative to this would be to
|
|
297
|
+
// resubscribe to the cache asynchonouly, which would bear the risk of
|
|
298
|
+
// missing further synchronous updates.
|
|
299
|
+
watch.lastDiff = undefined;
|
|
300
|
+
}
|
|
301
|
+
if (watch.lastOwnDiff === diff) {
|
|
302
|
+
// skip cache updates that were caused by our own writes
|
|
303
|
+
return;
|
|
304
|
+
}
|
|
305
|
+
const { result: previousResult } = this.subject.getValue();
|
|
306
|
+
if (!diff.complete &&
|
|
307
|
+
// If we are trying to deliver an incomplete cache result, we avoid
|
|
308
|
+
// reporting it if the query has errored, otherwise we let the broadcast try
|
|
309
|
+
// and repair the partial result by refetching the query. This check avoids
|
|
310
|
+
// a situation where a query that errors and another succeeds with
|
|
311
|
+
// overlapping data does not report the partial data result to the errored
|
|
312
|
+
// query.
|
|
313
|
+
//
|
|
314
|
+
// See https://github.com/apollographql/apollo-client/issues/11400 for more
|
|
315
|
+
// information on this issue.
|
|
316
|
+
(previousResult.error ||
|
|
317
|
+
// Prevent to schedule a notify directly after the `ObservableQuery`
|
|
318
|
+
// has been `reset` (which will set the `previousResult` to `uninitialized` or `empty`)
|
|
319
|
+
// as in those cases, `resetCache` will manually call `refetch` with more intentional timing.
|
|
320
|
+
previousResult === uninitialized ||
|
|
321
|
+
previousResult === empty)) {
|
|
322
|
+
return;
|
|
323
|
+
}
|
|
324
|
+
if (!(0, equality_1.equal)(previousResult.data, diff.result)) {
|
|
325
|
+
this.scheduleNotify();
|
|
326
|
+
}
|
|
327
|
+
},
|
|
328
|
+
};
|
|
329
|
+
const cancelWatch = this.cache.watch(watch);
|
|
330
|
+
this.unsubscribeFromCache = Object.assign(() => {
|
|
331
|
+
this.unsubscribeFromCache = undefined;
|
|
332
|
+
cancelWatch();
|
|
333
|
+
}, { query, variables });
|
|
334
|
+
}
|
|
335
|
+
stableLastResult;
|
|
336
|
+
getCurrentResult() {
|
|
337
|
+
const { result: current } = this.subject.getValue();
|
|
338
|
+
let value = (
|
|
339
|
+
// if the `current` result is in an error state, we will always return that
|
|
340
|
+
// error state, even if we have no observers
|
|
341
|
+
(current.networkStatus === networkStatus_js_1.NetworkStatus.error ||
|
|
342
|
+
// if we have observers, we are watching the cache and
|
|
343
|
+
// this.subject.getValue() will always be up to date
|
|
344
|
+
this.hasObservers() || // if we are using a `no-cache` fetch policy in which case this
|
|
345
|
+
// `ObservableQuery` cannot have been updated from the outside - in
|
|
346
|
+
// that case, we prefer to keep the current value
|
|
347
|
+
this.options.fetchPolicy === "no-cache")) ?
|
|
348
|
+
current
|
|
349
|
+
// otherwise, the `current` value might be outdated due to missed
|
|
350
|
+
// external updates - calculate it again
|
|
351
|
+
: this.getInitialResult();
|
|
352
|
+
if (value === uninitialized) {
|
|
353
|
+
value = this.getInitialResult();
|
|
354
|
+
}
|
|
355
|
+
if (!(0, equality_1.equal)(this.stableLastResult, value)) {
|
|
356
|
+
this.stableLastResult = value;
|
|
357
|
+
}
|
|
358
|
+
return this.stableLastResult;
|
|
359
|
+
}
|
|
360
|
+
/**
|
|
361
|
+
* Update the variables of this observable query, and fetch the new results.
|
|
362
|
+
* This method should be preferred over `setVariables` in most use cases.
|
|
363
|
+
*
|
|
364
|
+
* Returns a `ResultPromise` with an additional `.retain()` method. Calling
|
|
365
|
+
* `.retain()` keeps the network operation running even if the `ObservableQuery`
|
|
366
|
+
* no longer requires the result.
|
|
367
|
+
*
|
|
368
|
+
* Note: `refetch()` guarantees that a value will be emitted from the
|
|
369
|
+
* observable, even if the result is deep equal to the previous value.
|
|
370
|
+
*
|
|
371
|
+
* @param variables - The new set of variables. If there are missing variables,
|
|
372
|
+
* the previous values of those variables will be used.
|
|
373
|
+
*/
|
|
374
|
+
refetch(variables) {
|
|
375
|
+
const { fetchPolicy } = this.options;
|
|
376
|
+
const reobserveOptions = {
|
|
377
|
+
// Always disable polling for refetches.
|
|
378
|
+
pollInterval: 0,
|
|
379
|
+
};
|
|
380
|
+
// Unless the provided fetchPolicy always consults the network
|
|
381
|
+
// (no-cache, network-only, or cache-and-network), override it with
|
|
382
|
+
// network-only to force the refetch for this fetchQuery call.
|
|
383
|
+
if (fetchPolicy === "no-cache") {
|
|
384
|
+
reobserveOptions.fetchPolicy = "no-cache";
|
|
385
|
+
}
|
|
386
|
+
else {
|
|
387
|
+
reobserveOptions.fetchPolicy = "network-only";
|
|
388
|
+
}
|
|
389
|
+
if (environment_1.__DEV__ && variables && hasOwnProperty.call(variables, "variables")) {
|
|
390
|
+
const queryDef = (0, internal_1.getQueryDefinition)(this.query);
|
|
391
|
+
const vars = queryDef.variableDefinitions;
|
|
392
|
+
if (!vars || !vars.some((v) => v.variable.name.value === "variables")) {
|
|
393
|
+
__DEV__ && invariant_1.invariant.warn(81, variables, queryDef.name?.value || queryDef);
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
if (variables && !(0, equality_1.equal)(this.variables, variables)) {
|
|
397
|
+
// Update the existing options with new variables
|
|
398
|
+
reobserveOptions.variables = this.options.variables =
|
|
399
|
+
this.getVariablesWithDefaults({ ...this.variables, ...variables });
|
|
400
|
+
}
|
|
401
|
+
this._lastWrite = undefined;
|
|
402
|
+
return this._reobserve(reobserveOptions, {
|
|
403
|
+
newNetworkStatus: networkStatus_js_1.NetworkStatus.refetch,
|
|
404
|
+
});
|
|
405
|
+
}
|
|
406
|
+
fetchMore({ query, variables, context, errorPolicy, updateQuery, }) {
|
|
407
|
+
(0, invariant_1.invariant)(
|
|
408
|
+
this.options.fetchPolicy !== "cache-only",
|
|
409
|
+
82,
|
|
410
|
+
(0, internal_1.getOperationName)(this.query, "(anonymous)")
|
|
411
|
+
);
|
|
412
|
+
const combinedOptions = {
|
|
413
|
+
...(0, internal_1.compact)(this.options, { errorPolicy: "none" }, {
|
|
414
|
+
query,
|
|
415
|
+
context,
|
|
416
|
+
errorPolicy,
|
|
417
|
+
}),
|
|
418
|
+
variables: (query ? variables : ({
|
|
419
|
+
...this.variables,
|
|
420
|
+
...variables,
|
|
421
|
+
})),
|
|
422
|
+
// The fetchMore request goes immediately to the network and does
|
|
423
|
+
// not automatically write its result to the cache (hence no-cache
|
|
424
|
+
// instead of network-only), because we allow the caller of
|
|
425
|
+
// fetchMore to provide an updateQuery callback that determines how
|
|
426
|
+
// the data gets written to the cache.
|
|
427
|
+
fetchPolicy: "no-cache",
|
|
428
|
+
notifyOnNetworkStatusChange: this.options.notifyOnNetworkStatusChange,
|
|
429
|
+
};
|
|
430
|
+
combinedOptions.query = this.transformDocument(combinedOptions.query);
|
|
431
|
+
// If a temporary query is passed to `fetchMore`, we don't want to store
|
|
432
|
+
// it as the last query result since it may be an optimized query for
|
|
433
|
+
// pagination. We will however run the transforms on the original document
|
|
434
|
+
// as well as the document passed in `fetchMoreOptions` to ensure the cache
|
|
435
|
+
// uses the most up-to-date document which may rely on runtime conditionals.
|
|
436
|
+
this.lastQuery =
|
|
437
|
+
query ?
|
|
438
|
+
this.transformDocument(this.options.query)
|
|
439
|
+
: combinedOptions.query;
|
|
440
|
+
let wasUpdated = false;
|
|
441
|
+
const isCached = this.options.fetchPolicy !== "no-cache";
|
|
442
|
+
if (!isCached) {
|
|
443
|
+
(0, invariant_1.invariant)(updateQuery, 83);
|
|
444
|
+
}
|
|
445
|
+
const { finalize, pushNotification } = this.pushOperation(networkStatus_js_1.NetworkStatus.fetchMore);
|
|
446
|
+
pushNotification({
|
|
447
|
+
source: "newNetworkStatus",
|
|
448
|
+
kind: "N",
|
|
449
|
+
value: {},
|
|
450
|
+
}, { shouldEmit: 3 /* EmitBehavior.networkStatusChange */ });
|
|
451
|
+
const { promise, operator } = getTrackingOperatorPromise();
|
|
452
|
+
const { observable } = this.queryManager.fetchObservableWithInfo(combinedOptions, { networkStatus: networkStatus_js_1.NetworkStatus.fetchMore, exposeExtensions: true });
|
|
453
|
+
const subscription = observable
|
|
454
|
+
.pipe(operator, (0, rxjs_1.filter)((notification) => notification.kind === "N" && notification.source === "network"))
|
|
455
|
+
.subscribe({
|
|
456
|
+
next: (notification) => {
|
|
457
|
+
wasUpdated = false;
|
|
458
|
+
const fetchMoreResult = notification.value;
|
|
459
|
+
const extensions = fetchMoreResult[internal_1.extensionsSymbol];
|
|
460
|
+
if ((0, utilities_1.isNetworkRequestSettled)(notification.value.networkStatus)) {
|
|
461
|
+
finalize();
|
|
462
|
+
}
|
|
463
|
+
if (isCached) {
|
|
464
|
+
// Separately getting a diff here before the batch - `onWatchUpdated` might be
|
|
465
|
+
// called with an `undefined` `lastDiff` on the watcher if the cache was just subscribed to.
|
|
466
|
+
const lastDiff = this.getCacheDiff();
|
|
467
|
+
// Performing this cache update inside a cache.batch transaction ensures
|
|
468
|
+
// any affected cache.watch watchers are notified at most once about any
|
|
469
|
+
// updates. Most watchers will be using the QueryInfo class, which
|
|
470
|
+
// responds to notifications by calling reobserveCacheFirst to deliver
|
|
471
|
+
// fetchMore cache results back to this ObservableQuery.
|
|
472
|
+
this.cache.batch({
|
|
473
|
+
update: (cache) => {
|
|
474
|
+
if (updateQuery) {
|
|
475
|
+
cache.updateQuery({
|
|
476
|
+
query: this.query,
|
|
477
|
+
variables: this.variables,
|
|
478
|
+
returnPartialData: true,
|
|
479
|
+
optimistic: false,
|
|
480
|
+
extensions,
|
|
481
|
+
}, (previous) => updateQuery(previous, {
|
|
482
|
+
fetchMoreResult: fetchMoreResult.data,
|
|
483
|
+
variables: combinedOptions.variables,
|
|
484
|
+
}));
|
|
485
|
+
}
|
|
486
|
+
else {
|
|
487
|
+
// If we're using a field policy instead of updateQuery, the only
|
|
488
|
+
// thing we need to do is write the new data to the cache using
|
|
489
|
+
// combinedOptions.variables (instead of this.variables, which is
|
|
490
|
+
// what this.updateQuery uses, because it works by abusing the
|
|
491
|
+
// original field value, keyed by the original variables).
|
|
492
|
+
cache.writeQuery({
|
|
493
|
+
query: combinedOptions.query,
|
|
494
|
+
variables: combinedOptions.variables,
|
|
495
|
+
data: fetchMoreResult.data,
|
|
496
|
+
extensions,
|
|
497
|
+
});
|
|
498
|
+
}
|
|
499
|
+
},
|
|
500
|
+
onWatchUpdated: (watch, diff) => {
|
|
501
|
+
if (watch.watcher === this &&
|
|
502
|
+
!(0, equality_1.equal)(diff.result, lastDiff.result)) {
|
|
503
|
+
wasUpdated = true;
|
|
504
|
+
const lastResult = this.getCurrentResult();
|
|
505
|
+
// Let the cache watch from resubscribeCache handle the final
|
|
506
|
+
// result
|
|
507
|
+
if ((0, utilities_1.isNetworkRequestInFlight)(fetchMoreResult.networkStatus)) {
|
|
508
|
+
pushNotification({
|
|
509
|
+
kind: "N",
|
|
510
|
+
source: "network",
|
|
511
|
+
value: {
|
|
512
|
+
...lastResult,
|
|
513
|
+
networkStatus: (fetchMoreResult.networkStatus ===
|
|
514
|
+
networkStatus_js_1.NetworkStatus.error) ?
|
|
515
|
+
networkStatus_js_1.NetworkStatus.ready
|
|
516
|
+
: fetchMoreResult.networkStatus,
|
|
517
|
+
// will be overwritten anyways, just here for types sake
|
|
518
|
+
loading: false,
|
|
519
|
+
data: diff.result,
|
|
520
|
+
dataState: fetchMoreResult.dataState === "streaming" ?
|
|
521
|
+
"streaming"
|
|
522
|
+
: "complete",
|
|
523
|
+
},
|
|
524
|
+
});
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
},
|
|
528
|
+
});
|
|
529
|
+
}
|
|
530
|
+
else {
|
|
531
|
+
// There is a possibility `lastResult` may not be set when
|
|
532
|
+
// `fetchMore` is called which would cause this to crash. This should
|
|
533
|
+
// only happen if we haven't previously reported a result. We don't
|
|
534
|
+
// quite know what the right behavior should be here since this block
|
|
535
|
+
// of code runs after the fetch result has executed on the network.
|
|
536
|
+
// We plan to let it crash in the meantime.
|
|
537
|
+
//
|
|
538
|
+
// If we get bug reports due to the `data` property access on
|
|
539
|
+
// undefined, this should give us a real-world scenario that we can
|
|
540
|
+
// use to test against and determine the right behavior. If we do end
|
|
541
|
+
// up changing this behavior, this may require, for example, an
|
|
542
|
+
// adjustment to the types on `updateQuery` since that function
|
|
543
|
+
// expects that the first argument always contains previous result
|
|
544
|
+
// data, but not `undefined`.
|
|
545
|
+
const lastResult = this.getCurrentResult();
|
|
546
|
+
const data = updateQuery(lastResult.data, {
|
|
547
|
+
fetchMoreResult: fetchMoreResult.data,
|
|
548
|
+
variables: combinedOptions.variables,
|
|
549
|
+
});
|
|
550
|
+
pushNotification({
|
|
551
|
+
kind: "N",
|
|
552
|
+
value: {
|
|
553
|
+
...lastResult,
|
|
554
|
+
networkStatus: networkStatus_js_1.NetworkStatus.ready,
|
|
555
|
+
// will be overwritten anyways, just here for types sake
|
|
556
|
+
loading: false,
|
|
557
|
+
data: data,
|
|
558
|
+
dataState: lastResult.dataState === "streaming" ?
|
|
559
|
+
"streaming"
|
|
560
|
+
: "complete",
|
|
561
|
+
},
|
|
562
|
+
source: "network",
|
|
563
|
+
});
|
|
564
|
+
}
|
|
565
|
+
},
|
|
566
|
+
});
|
|
567
|
+
return (0, internal_1.preventUnhandledRejection)(promise
|
|
568
|
+
.then((result) => (0, internal_1.toQueryResult)(this.maskResult(result)))
|
|
569
|
+
.finally(() => {
|
|
570
|
+
subscription.unsubscribe();
|
|
571
|
+
finalize();
|
|
572
|
+
if (isCached && !wasUpdated) {
|
|
573
|
+
const lastResult = this.getCurrentResult();
|
|
574
|
+
if (lastResult.dataState === "streaming") {
|
|
575
|
+
pushNotification({
|
|
576
|
+
kind: "N",
|
|
577
|
+
source: "network",
|
|
578
|
+
value: {
|
|
579
|
+
...lastResult,
|
|
580
|
+
dataState: "complete",
|
|
581
|
+
networkStatus: networkStatus_js_1.NetworkStatus.ready,
|
|
582
|
+
},
|
|
583
|
+
});
|
|
584
|
+
}
|
|
585
|
+
else {
|
|
586
|
+
pushNotification({
|
|
587
|
+
kind: "N",
|
|
588
|
+
source: "newNetworkStatus",
|
|
589
|
+
value: {},
|
|
590
|
+
}, { shouldEmit: 1 /* EmitBehavior.force */ });
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
}));
|
|
594
|
+
}
|
|
595
|
+
// XXX the subscription variables are separate from the query variables.
|
|
596
|
+
// if you want to update subscription variables, right now you have to do that separately,
|
|
597
|
+
// and you can only do it by stopping the subscription and then subscribing again with new variables.
|
|
598
|
+
/**
|
|
599
|
+
* A function that enables you to execute a [subscription](https://www.apollographql.com/docs/react/data/subscriptions/), usually to subscribe to specific fields that were included in the query.
|
|
600
|
+
*
|
|
601
|
+
* This function returns _another_ function that you can call to terminate the subscription.
|
|
602
|
+
*/
|
|
603
|
+
subscribeToMore(options) {
|
|
604
|
+
const subscription = this.queryManager
|
|
605
|
+
.startGraphQLSubscription({
|
|
606
|
+
query: options.document,
|
|
607
|
+
variables: options.variables,
|
|
608
|
+
context: options.context,
|
|
609
|
+
})
|
|
610
|
+
.subscribe({
|
|
611
|
+
next: (subscriptionData) => {
|
|
612
|
+
const { updateQuery, onError } = options;
|
|
613
|
+
const { error } = subscriptionData;
|
|
614
|
+
if (error) {
|
|
615
|
+
if (onError) {
|
|
616
|
+
onError(error);
|
|
617
|
+
}
|
|
618
|
+
else {
|
|
619
|
+
invariant_1.invariant.error(84, error);
|
|
620
|
+
}
|
|
621
|
+
return;
|
|
622
|
+
}
|
|
623
|
+
if (updateQuery) {
|
|
624
|
+
this.updateQuery((previous, updateOptions) => updateQuery(previous, {
|
|
625
|
+
subscriptionData: subscriptionData,
|
|
626
|
+
...updateOptions,
|
|
627
|
+
}));
|
|
628
|
+
}
|
|
629
|
+
},
|
|
630
|
+
});
|
|
631
|
+
this.subscriptions.add(subscription);
|
|
632
|
+
return () => {
|
|
633
|
+
if (this.subscriptions.delete(subscription)) {
|
|
634
|
+
subscription.unsubscribe();
|
|
635
|
+
}
|
|
636
|
+
};
|
|
637
|
+
}
|
|
638
|
+
/**
|
|
639
|
+
* @internal
|
|
640
|
+
*
|
|
641
|
+
* @deprecated This is an internal API and should not be used directly. This can be removed or changed at any time.
|
|
642
|
+
*/
|
|
643
|
+
applyOptions(newOptions) {
|
|
644
|
+
const mergedOptions = (0, internal_1.compact)(this.options, newOptions || {});
|
|
645
|
+
assign(this.options, mergedOptions);
|
|
646
|
+
this.updatePolling();
|
|
647
|
+
}
|
|
648
|
+
/**
|
|
649
|
+
* Update the variables of this observable query, and fetch the new results
|
|
650
|
+
* if they've changed. Most users should prefer `refetch` instead of
|
|
651
|
+
* `setVariables` in order to to be properly notified of results even when
|
|
652
|
+
* they come from the cache.
|
|
653
|
+
*
|
|
654
|
+
* Note: `setVariables()` guarantees that a value will be emitted from the
|
|
655
|
+
* observable, even if the result is deeply equal to the previous value.
|
|
656
|
+
*
|
|
657
|
+
* Note: the promise will resolve with the last emitted result
|
|
658
|
+
* when either the variables match the current variables or there
|
|
659
|
+
* are no subscribers to the query.
|
|
660
|
+
*
|
|
661
|
+
* @param variables - The new set of variables. If there are missing variables,
|
|
662
|
+
* the previous values of those variables will be used.
|
|
663
|
+
*/
|
|
664
|
+
async setVariables(variables) {
|
|
665
|
+
variables = this.getVariablesWithDefaults(variables);
|
|
666
|
+
if ((0, equality_1.equal)(this.variables, variables)) {
|
|
667
|
+
// If we have no observers, then we don't actually want to make a network
|
|
668
|
+
// request. As soon as someone observes the query, the request will kick
|
|
669
|
+
// off. For now, we just store any changes. (See #1077)
|
|
670
|
+
return (0, internal_1.toQueryResult)(this.getCurrentResult());
|
|
671
|
+
}
|
|
672
|
+
this.options.variables = variables;
|
|
673
|
+
// See comment above
|
|
674
|
+
if (!this.hasObservers()) {
|
|
675
|
+
return (0, internal_1.toQueryResult)(this.getCurrentResult());
|
|
676
|
+
}
|
|
677
|
+
return this._reobserve({
|
|
678
|
+
// Reset options.fetchPolicy to its original value.
|
|
679
|
+
fetchPolicy: this.options.initialFetchPolicy,
|
|
680
|
+
variables,
|
|
681
|
+
}, { newNetworkStatus: networkStatus_js_1.NetworkStatus.setVariables });
|
|
682
|
+
}
|
|
683
|
+
/**
|
|
684
|
+
* A function that enables you to update the query's cached result without executing a followup GraphQL operation.
|
|
685
|
+
*
|
|
686
|
+
* See [using updateQuery and updateFragment](https://www.apollographql.com/docs/react/caching/cache-interaction/#using-updatequery-and-updatefragment) for additional information.
|
|
687
|
+
*/
|
|
688
|
+
updateQuery(mapFn) {
|
|
689
|
+
const { queryManager } = this;
|
|
690
|
+
const { result, complete } = this.getCacheDiff({ optimistic: false });
|
|
691
|
+
const newResult = mapFn(result, {
|
|
692
|
+
variables: this.variables,
|
|
693
|
+
complete: !!complete,
|
|
694
|
+
previousData: result,
|
|
695
|
+
});
|
|
696
|
+
if (newResult) {
|
|
697
|
+
this.cache.writeQuery({
|
|
698
|
+
query: this.options.query,
|
|
699
|
+
data: newResult,
|
|
700
|
+
variables: this.variables,
|
|
701
|
+
});
|
|
702
|
+
queryManager.broadcastQueries();
|
|
703
|
+
}
|
|
704
|
+
}
|
|
705
|
+
/**
|
|
706
|
+
* A function that instructs the query to begin re-executing at a specified interval (in milliseconds).
|
|
707
|
+
*/
|
|
708
|
+
startPolling(pollInterval) {
|
|
709
|
+
this.options.pollInterval = pollInterval;
|
|
710
|
+
this.updatePolling();
|
|
711
|
+
}
|
|
712
|
+
/**
|
|
713
|
+
* A function that instructs the query to stop polling after a previous call to `startPolling`.
|
|
714
|
+
*/
|
|
715
|
+
stopPolling() {
|
|
716
|
+
this.options.pollInterval = 0;
|
|
717
|
+
this.updatePolling();
|
|
718
|
+
}
|
|
719
|
+
// Update options.fetchPolicy according to options.nextFetchPolicy.
|
|
720
|
+
applyNextFetchPolicy(reason,
|
|
721
|
+
// It's possible to use this method to apply options.nextFetchPolicy to
|
|
722
|
+
// options.fetchPolicy even if options !== this.options, though that happens
|
|
723
|
+
// most often when the options are temporary, used for only one request and
|
|
724
|
+
// then thrown away, so nextFetchPolicy may not end up mattering.
|
|
725
|
+
options) {
|
|
726
|
+
if (options.nextFetchPolicy) {
|
|
727
|
+
const { fetchPolicy = "cache-first", initialFetchPolicy = fetchPolicy } = options;
|
|
728
|
+
if (fetchPolicy === "standby") {
|
|
729
|
+
// Do nothing, leaving options.fetchPolicy unchanged.
|
|
730
|
+
}
|
|
731
|
+
else if (typeof options.nextFetchPolicy === "function") {
|
|
732
|
+
// When someone chooses "cache-and-network" or "network-only" as their
|
|
733
|
+
// initial FetchPolicy, they often do not want future cache updates to
|
|
734
|
+
// trigger unconditional network requests, which is what repeatedly
|
|
735
|
+
// applying the "cache-and-network" or "network-only" policies would
|
|
736
|
+
// seem to imply. Instead, when the cache reports an update after the
|
|
737
|
+
// initial network request, it may be desirable for subsequent network
|
|
738
|
+
// requests to be triggered only if the cache result is incomplete. To
|
|
739
|
+
// that end, the options.nextFetchPolicy option provides an easy way to
|
|
740
|
+
// update options.fetchPolicy after the initial network request, without
|
|
741
|
+
// having to call observableQuery.reobserve.
|
|
742
|
+
options.fetchPolicy = options.nextFetchPolicy.call(options, fetchPolicy, { reason, options, observable: this, initialFetchPolicy });
|
|
743
|
+
}
|
|
744
|
+
else if (reason === "variables-changed") {
|
|
745
|
+
options.fetchPolicy = initialFetchPolicy;
|
|
746
|
+
}
|
|
747
|
+
else {
|
|
748
|
+
options.fetchPolicy = options.nextFetchPolicy;
|
|
749
|
+
}
|
|
750
|
+
}
|
|
751
|
+
return options.fetchPolicy;
|
|
752
|
+
}
|
|
753
|
+
fetch(options, networkStatus, fetchQuery, operator) {
|
|
754
|
+
// TODO Make sure we update the networkStatus (and infer fetchVariables)
|
|
755
|
+
// before actually committing to the fetch.
|
|
756
|
+
const initialFetchPolicy = this.options.fetchPolicy;
|
|
757
|
+
options.context ??= {};
|
|
758
|
+
let synchronouslyEmitted = false;
|
|
759
|
+
const onCacheHit = () => {
|
|
760
|
+
synchronouslyEmitted = true;
|
|
761
|
+
};
|
|
762
|
+
const fetchQueryOperator = // we cannot use `tap` here, since it allows only for a "before subscription"
|
|
763
|
+
|
|
764
|
+
// hook with `subscribe` and we care for "directly before and after subscription"
|
|
765
|
+
(source) => new rxjs_1.Observable((subscriber) => {
|
|
766
|
+
try {
|
|
767
|
+
return source.subscribe({
|
|
768
|
+
next(value) {
|
|
769
|
+
synchronouslyEmitted = true;
|
|
770
|
+
subscriber.next(value);
|
|
771
|
+
},
|
|
772
|
+
error: (error) => subscriber.error(error),
|
|
773
|
+
complete: () => subscriber.complete(),
|
|
774
|
+
});
|
|
775
|
+
}
|
|
776
|
+
finally {
|
|
777
|
+
if (!synchronouslyEmitted) {
|
|
778
|
+
operation.override = networkStatus;
|
|
779
|
+
this.input.next({
|
|
780
|
+
kind: "N",
|
|
781
|
+
source: "newNetworkStatus",
|
|
782
|
+
value: {
|
|
783
|
+
resetError: true,
|
|
784
|
+
},
|
|
785
|
+
query,
|
|
786
|
+
variables,
|
|
787
|
+
meta: {
|
|
788
|
+
shouldEmit: 3 /* EmitBehavior.networkStatusChange */,
|
|
789
|
+
/*
|
|
790
|
+
* The moment this notification is emitted, `nextFetchPolicy`
|
|
791
|
+
* might already have switched from a `network-only` to a
|
|
792
|
+
* `cache-something` policy, so we want to ensure that the
|
|
793
|
+
* loading state emit doesn't accidentally read from the cache
|
|
794
|
+
* in those cases.
|
|
795
|
+
*/
|
|
796
|
+
fetchPolicy: initialFetchPolicy,
|
|
797
|
+
},
|
|
798
|
+
});
|
|
799
|
+
}
|
|
800
|
+
}
|
|
801
|
+
});
|
|
802
|
+
let { observable, fromLink } = this.queryManager.fetchObservableWithInfo(options, {
|
|
803
|
+
networkStatus,
|
|
804
|
+
query: fetchQuery,
|
|
805
|
+
onCacheHit,
|
|
806
|
+
fetchQueryOperator,
|
|
807
|
+
observableQuery: this,
|
|
808
|
+
});
|
|
809
|
+
// track query and variables from the start of the operation
|
|
810
|
+
const { query, variables } = this;
|
|
811
|
+
const operation = {
|
|
812
|
+
abort: () => {
|
|
813
|
+
subscription.unsubscribe();
|
|
814
|
+
},
|
|
815
|
+
query,
|
|
816
|
+
variables,
|
|
817
|
+
};
|
|
818
|
+
this.activeOperations.add(operation);
|
|
819
|
+
let forceFirstValueEmit = networkStatus == networkStatus_js_1.NetworkStatus.refetch ||
|
|
820
|
+
networkStatus == networkStatus_js_1.NetworkStatus.setVariables;
|
|
821
|
+
observable = observable.pipe(operator, (0, rxjs_1.share)());
|
|
822
|
+
const subscription = observable
|
|
823
|
+
.pipe((0, rxjs_1.tap)({
|
|
824
|
+
next: (notification) => {
|
|
825
|
+
if (notification.source === "newNetworkStatus" ||
|
|
826
|
+
(notification.kind === "N" && notification.value.loading)) {
|
|
827
|
+
operation.override = networkStatus;
|
|
828
|
+
}
|
|
829
|
+
else {
|
|
830
|
+
delete operation.override;
|
|
831
|
+
}
|
|
832
|
+
},
|
|
833
|
+
finalize: () => this.activeOperations.delete(operation),
|
|
834
|
+
}))
|
|
835
|
+
.subscribe({
|
|
836
|
+
next: (value) => {
|
|
837
|
+
const meta = {};
|
|
838
|
+
if (forceFirstValueEmit &&
|
|
839
|
+
value.kind === "N" &&
|
|
840
|
+
"loading" in value.value &&
|
|
841
|
+
!value.value.loading) {
|
|
842
|
+
forceFirstValueEmit = false;
|
|
843
|
+
meta.shouldEmit = 1 /* EmitBehavior.force */;
|
|
844
|
+
}
|
|
845
|
+
this.input.next({ ...value, query, variables, meta });
|
|
846
|
+
},
|
|
847
|
+
});
|
|
848
|
+
return { fromLink, subscription, observable };
|
|
849
|
+
}
|
|
850
|
+
// Turns polling on or off based on this.options.pollInterval.
|
|
851
|
+
didWarnCacheOnlyPolling = false;
|
|
852
|
+
updatePolling() {
|
|
853
|
+
// Avoid polling in SSR mode
|
|
854
|
+
if (this.queryManager.ssrMode) {
|
|
855
|
+
return;
|
|
856
|
+
}
|
|
857
|
+
const { pollingInfo, options: { fetchPolicy, pollInterval }, } = this;
|
|
858
|
+
const shouldCancelPolling = () => {
|
|
859
|
+
const { options } = this;
|
|
860
|
+
return (!options.pollInterval ||
|
|
861
|
+
!this.hasObservers() ||
|
|
862
|
+
options.fetchPolicy === "cache-only" ||
|
|
863
|
+
options.fetchPolicy === "standby");
|
|
864
|
+
};
|
|
865
|
+
if (shouldCancelPolling()) {
|
|
866
|
+
if (environment_1.__DEV__) {
|
|
867
|
+
if (!this.didWarnCacheOnlyPolling &&
|
|
868
|
+
pollInterval &&
|
|
869
|
+
fetchPolicy === "cache-only") {
|
|
870
|
+
__DEV__ && invariant_1.invariant.warn(85, (0, internal_1.getOperationName)(this.query, "(anonymous)"));
|
|
871
|
+
this.didWarnCacheOnlyPolling = true;
|
|
872
|
+
}
|
|
873
|
+
}
|
|
874
|
+
this.cancelPolling();
|
|
875
|
+
return;
|
|
876
|
+
}
|
|
877
|
+
if (pollingInfo?.interval === pollInterval) {
|
|
878
|
+
return;
|
|
879
|
+
}
|
|
880
|
+
const info = pollingInfo || (this.pollingInfo = {});
|
|
881
|
+
info.interval = pollInterval;
|
|
882
|
+
const maybeFetch = () => {
|
|
883
|
+
// defense against options changing after the setTimeout changes in case
|
|
884
|
+
// the call site forgets to call cancelPolling
|
|
885
|
+
if (shouldCancelPolling()) {
|
|
886
|
+
return this.cancelPolling();
|
|
887
|
+
}
|
|
888
|
+
if (this.pollingInfo) {
|
|
889
|
+
if (!(0, utilities_1.isNetworkRequestInFlight)(this.networkStatus) &&
|
|
890
|
+
!this.options.skipPollAttempt?.()) {
|
|
891
|
+
this._reobserve({
|
|
892
|
+
// Most fetchPolicy options don't make sense to use in a polling context, as
|
|
893
|
+
// users wouldn't want to be polling the cache directly. However, network-only and
|
|
894
|
+
// no-cache are both useful for when the user wants to control whether or not the
|
|
895
|
+
// polled results are written to the cache.
|
|
896
|
+
fetchPolicy: this.options.initialFetchPolicy === "no-cache" ?
|
|
897
|
+
"no-cache"
|
|
898
|
+
: "network-only",
|
|
899
|
+
}, {
|
|
900
|
+
newNetworkStatus: networkStatus_js_1.NetworkStatus.poll,
|
|
901
|
+
}).then(poll, poll);
|
|
902
|
+
}
|
|
903
|
+
else {
|
|
904
|
+
poll();
|
|
905
|
+
}
|
|
906
|
+
}
|
|
907
|
+
};
|
|
908
|
+
const poll = () => {
|
|
909
|
+
const info = this.pollingInfo;
|
|
910
|
+
if (info) {
|
|
911
|
+
clearTimeout(info.timeout);
|
|
912
|
+
info.timeout = setTimeout(maybeFetch, info.interval);
|
|
913
|
+
}
|
|
914
|
+
};
|
|
915
|
+
poll();
|
|
916
|
+
}
|
|
917
|
+
// This differs from stopPolling in that it does not set pollInterval to 0
|
|
918
|
+
cancelPolling() {
|
|
919
|
+
if (this.pollingInfo) {
|
|
920
|
+
clearTimeout(this.pollingInfo.timeout);
|
|
921
|
+
delete this.pollingInfo;
|
|
922
|
+
}
|
|
923
|
+
}
|
|
924
|
+
/**
|
|
925
|
+
* Reevaluate the query, optionally against new options. New options will be
|
|
926
|
+
* merged with the current options when given.
|
|
927
|
+
*
|
|
928
|
+
* Note: `variables` can be reset back to their defaults (typically empty) by calling `reobserve` with
|
|
929
|
+
* `variables: undefined`.
|
|
930
|
+
*/
|
|
931
|
+
reobserve(newOptions) {
|
|
932
|
+
return this._reobserve(newOptions);
|
|
933
|
+
}
|
|
934
|
+
_reobserve(newOptions, internalOptions) {
|
|
935
|
+
this.isTornDown = false;
|
|
936
|
+
let { newNetworkStatus } = internalOptions || {};
|
|
937
|
+
this.queryManager.obsQueries.add(this);
|
|
938
|
+
const useDisposableObservable =
|
|
939
|
+
// Refetching uses a disposable Observable to allow refetches using different
|
|
940
|
+
// options, without permanently altering the options of the
|
|
941
|
+
// original ObservableQuery.
|
|
942
|
+
newNetworkStatus === networkStatus_js_1.NetworkStatus.refetch ||
|
|
943
|
+
// Polling uses a disposable Observable so the polling options (which force
|
|
944
|
+
// fetchPolicy to be "network-only" or "no-cache") won't override the original options.
|
|
945
|
+
newNetworkStatus === networkStatus_js_1.NetworkStatus.poll;
|
|
946
|
+
// Save the old variables, since Object.assign may modify them below.
|
|
947
|
+
const oldVariables = this.variables;
|
|
948
|
+
const oldFetchPolicy = this.options.fetchPolicy;
|
|
949
|
+
const mergedOptions = (0, internal_1.compact)(this.options, newOptions || {});
|
|
950
|
+
// This request will hit the network, so even if there are no variables,
|
|
951
|
+
// we now know that's intentional. (see #12996)
|
|
952
|
+
// Even if that happens only once, we want `variablesUnknown` to stay false permanently.
|
|
953
|
+
this.variablesUnknown &&= mergedOptions.fetchPolicy === "standby";
|
|
954
|
+
const options = useDisposableObservable ?
|
|
955
|
+
// Disposable Observable fetches receive a shallow copy of this.options
|
|
956
|
+
// (merged with newOptions), leaving this.options unmodified.
|
|
957
|
+
mergedOptions
|
|
958
|
+
: assign(this.options, mergedOptions);
|
|
959
|
+
// Don't update options.query with the transformed query to avoid
|
|
960
|
+
// overwriting this.options.query when we aren't using a disposable concast.
|
|
961
|
+
// We want to ensure we can re-run the custom document transforms the next
|
|
962
|
+
// time a request is made against the original query.
|
|
963
|
+
const query = this.transformDocument(options.query);
|
|
964
|
+
this.lastQuery = query;
|
|
965
|
+
// Reevaluate variables to allow resetting variables with variables: undefined,
|
|
966
|
+
// otherwise `compact` will ignore the `variables` key in `newOptions`. We
|
|
967
|
+
// do this after we run the query transform to ensure we get default
|
|
968
|
+
// variables from the transformed query.
|
|
969
|
+
//
|
|
970
|
+
// Note: updating options.variables may mutate this.options.variables
|
|
971
|
+
// in the case of a non-disposable query. This is intentional.
|
|
972
|
+
if (newOptions && "variables" in newOptions) {
|
|
973
|
+
options.variables = this.getVariablesWithDefaults(newOptions.variables);
|
|
974
|
+
}
|
|
975
|
+
if (!useDisposableObservable) {
|
|
976
|
+
// We can skip calling updatePolling if we're not changing this.options.
|
|
977
|
+
this.updatePolling();
|
|
978
|
+
// Reset options.fetchPolicy to its original value when variables change,
|
|
979
|
+
// unless a new fetchPolicy was provided by newOptions.
|
|
980
|
+
if (newOptions &&
|
|
981
|
+
newOptions.variables &&
|
|
982
|
+
!(0, equality_1.equal)(newOptions.variables, oldVariables) &&
|
|
983
|
+
// Don't mess with the fetchPolicy if it's currently "standby".
|
|
984
|
+
options.fetchPolicy !== "standby" &&
|
|
985
|
+
// If we're changing the fetchPolicy anyway, don't try to change it here
|
|
986
|
+
// using applyNextFetchPolicy. The explicit options.fetchPolicy wins.
|
|
987
|
+
(options.fetchPolicy === oldFetchPolicy ||
|
|
988
|
+
// A `nextFetchPolicy` function has even higher priority, though,
|
|
989
|
+
// so in that case `applyNextFetchPolicy` must be called.
|
|
990
|
+
typeof options.nextFetchPolicy === "function")) {
|
|
991
|
+
// This might mutate options.fetchPolicy
|
|
992
|
+
this.applyNextFetchPolicy("variables-changed", options);
|
|
993
|
+
if (newNetworkStatus === void 0) {
|
|
994
|
+
newNetworkStatus = networkStatus_js_1.NetworkStatus.setVariables;
|
|
995
|
+
}
|
|
996
|
+
}
|
|
997
|
+
}
|
|
998
|
+
const oldNetworkStatus = this.networkStatus;
|
|
999
|
+
if (!newNetworkStatus) {
|
|
1000
|
+
newNetworkStatus = networkStatus_js_1.NetworkStatus.loading;
|
|
1001
|
+
if (oldNetworkStatus !== networkStatus_js_1.NetworkStatus.loading &&
|
|
1002
|
+
newOptions?.variables &&
|
|
1003
|
+
!(0, equality_1.equal)(newOptions.variables, oldVariables)) {
|
|
1004
|
+
newNetworkStatus = networkStatus_js_1.NetworkStatus.setVariables;
|
|
1005
|
+
}
|
|
1006
|
+
// QueryManager does not emit any values for standby fetch policies so we
|
|
1007
|
+
// want ensure that the networkStatus remains ready.
|
|
1008
|
+
if (options.fetchPolicy === "standby") {
|
|
1009
|
+
newNetworkStatus = networkStatus_js_1.NetworkStatus.ready;
|
|
1010
|
+
}
|
|
1011
|
+
}
|
|
1012
|
+
if (options.fetchPolicy === "standby") {
|
|
1013
|
+
this.cancelPolling();
|
|
1014
|
+
}
|
|
1015
|
+
this.resubscribeCache();
|
|
1016
|
+
const { promise, operator: promiseOperator } = getTrackingOperatorPromise(
|
|
1017
|
+
// This default value should only be used when using a `fetchPolicy` of
|
|
1018
|
+
// `standby` since that fetch policy completes without emitting a
|
|
1019
|
+
// result. Since we are converting this to a QueryResult type, we
|
|
1020
|
+
// omit the extra fields from ApolloQueryResult in the default value.
|
|
1021
|
+
options.fetchPolicy === "standby" ?
|
|
1022
|
+
{ data: undefined }
|
|
1023
|
+
: undefined);
|
|
1024
|
+
const { subscription, observable, fromLink } = this.fetch(options, newNetworkStatus, query, promiseOperator);
|
|
1025
|
+
if (!useDisposableObservable && (fromLink || !this.linkSubscription)) {
|
|
1026
|
+
if (this.linkSubscription) {
|
|
1027
|
+
this.linkSubscription.unsubscribe();
|
|
1028
|
+
}
|
|
1029
|
+
this.linkSubscription = subscription;
|
|
1030
|
+
}
|
|
1031
|
+
const ret = Object.assign((0, internal_1.preventUnhandledRejection)(promise
|
|
1032
|
+
.then((result) => (0, internal_1.toQueryResult)(this.maskResult(result)))
|
|
1033
|
+
.finally(() => {
|
|
1034
|
+
if (!this.hasObservers() && this.activeOperations.size === 0) {
|
|
1035
|
+
// If `reobserve` was called on a query without any observers,
|
|
1036
|
+
// the teardown logic would never be called, so we need to
|
|
1037
|
+
// call it here to ensure the query is properly torn down.
|
|
1038
|
+
this.tearDownQuery();
|
|
1039
|
+
}
|
|
1040
|
+
})), {
|
|
1041
|
+
retain: () => {
|
|
1042
|
+
const subscription = observable.subscribe({});
|
|
1043
|
+
const unsubscribe = () => subscription.unsubscribe();
|
|
1044
|
+
promise.then(unsubscribe, unsubscribe);
|
|
1045
|
+
return ret;
|
|
1046
|
+
},
|
|
1047
|
+
});
|
|
1048
|
+
return ret;
|
|
1049
|
+
}
|
|
1050
|
+
hasObservers() {
|
|
1051
|
+
return this.subject.observed;
|
|
1052
|
+
}
|
|
1053
|
+
/**
|
|
1054
|
+
* Tears down the `ObservableQuery` and stops all active operations by sending a `complete` notification.
|
|
1055
|
+
*/
|
|
1056
|
+
stop() {
|
|
1057
|
+
this.subject.complete();
|
|
1058
|
+
this.initializeObservablesQueue();
|
|
1059
|
+
this.tearDownQuery();
|
|
1060
|
+
}
|
|
1061
|
+
tearDownQuery() {
|
|
1062
|
+
if (this.isTornDown)
|
|
1063
|
+
return;
|
|
1064
|
+
this.resetNotifications();
|
|
1065
|
+
this.unsubscribeFromCache?.();
|
|
1066
|
+
if (this.linkSubscription) {
|
|
1067
|
+
this.linkSubscription.unsubscribe();
|
|
1068
|
+
delete this.linkSubscription;
|
|
1069
|
+
}
|
|
1070
|
+
this.stopPolling();
|
|
1071
|
+
// stop all active GraphQL subscriptions
|
|
1072
|
+
this.subscriptions.forEach((sub) => sub.unsubscribe());
|
|
1073
|
+
this.subscriptions.clear();
|
|
1074
|
+
this.queryManager.obsQueries.delete(this);
|
|
1075
|
+
this.isTornDown = true;
|
|
1076
|
+
this.abortActiveOperations();
|
|
1077
|
+
this._lastWrite = undefined;
|
|
1078
|
+
}
|
|
1079
|
+
transformDocument(document) {
|
|
1080
|
+
return this.queryManager.transform(document);
|
|
1081
|
+
}
|
|
1082
|
+
maskResult(result) {
|
|
1083
|
+
const masked = this.queryManager.maskOperation({
|
|
1084
|
+
document: this.query,
|
|
1085
|
+
data: result.data,
|
|
1086
|
+
fetchPolicy: this.options.fetchPolicy,
|
|
1087
|
+
cause: this,
|
|
1088
|
+
});
|
|
1089
|
+
// Maintain object identity as much as possible
|
|
1090
|
+
return masked === result.data ? result : { ...result, data: masked };
|
|
1091
|
+
}
|
|
1092
|
+
dirty = false;
|
|
1093
|
+
notifyTimeout;
|
|
1094
|
+
/**
|
|
1095
|
+
* @internal
|
|
1096
|
+
*
|
|
1097
|
+
* @deprecated This is an internal API and should not be used directly. This can be removed or changed at any time.
|
|
1098
|
+
*/
|
|
1099
|
+
resetNotifications() {
|
|
1100
|
+
if (this.notifyTimeout) {
|
|
1101
|
+
clearTimeout(this.notifyTimeout);
|
|
1102
|
+
this.notifyTimeout = void 0;
|
|
1103
|
+
}
|
|
1104
|
+
this.dirty = false;
|
|
1105
|
+
}
|
|
1106
|
+
/**
|
|
1107
|
+
* @internal
|
|
1108
|
+
*
|
|
1109
|
+
* @deprecated This is an internal API and should not be used directly. This can be removed or changed at any time.
|
|
1110
|
+
*/
|
|
1111
|
+
scheduleNotify() {
|
|
1112
|
+
if (this.dirty)
|
|
1113
|
+
return;
|
|
1114
|
+
this.dirty = true;
|
|
1115
|
+
if (!this.notifyTimeout) {
|
|
1116
|
+
this.notifyTimeout = setTimeout(() => this.notify(true), 0);
|
|
1117
|
+
}
|
|
1118
|
+
}
|
|
1119
|
+
/**
|
|
1120
|
+
* @internal
|
|
1121
|
+
*
|
|
1122
|
+
* @deprecated This is an internal API and should not be used directly. This can be removed or changed at any time.
|
|
1123
|
+
*/
|
|
1124
|
+
notify(scheduled = false) {
|
|
1125
|
+
if (!scheduled) {
|
|
1126
|
+
// For queries with client exports or forced resolvers, we don't want to
|
|
1127
|
+
// synchronously reobserve the cache on broadcast,
|
|
1128
|
+
// but actually wait for the `scheduleNotify` timeout triggered by the
|
|
1129
|
+
// `cache.watch` callback from `resubscribeCache`.
|
|
1130
|
+
const info = this.queryManager.getDocumentInfo(this.query);
|
|
1131
|
+
if (info.hasClientExports || info.hasForcedResolvers) {
|
|
1132
|
+
return;
|
|
1133
|
+
}
|
|
1134
|
+
}
|
|
1135
|
+
const { dirty } = this;
|
|
1136
|
+
this.resetNotifications();
|
|
1137
|
+
if (dirty &&
|
|
1138
|
+
(this.options.fetchPolicy === "cache-only" ||
|
|
1139
|
+
this.options.fetchPolicy === "cache-and-network" ||
|
|
1140
|
+
!this.activeOperations.size)) {
|
|
1141
|
+
const diff = this.getCacheDiff();
|
|
1142
|
+
if (
|
|
1143
|
+
// `fromOptimisticTransaction` is not available through the `cache.diff`
|
|
1144
|
+
// code path, so we need to check it this way
|
|
1145
|
+
(0, equality_1.equal)(diff.result, this.getCacheDiff({ optimistic: false }).result)) {
|
|
1146
|
+
//If this diff did not come from an optimistic transaction
|
|
1147
|
+
// make the ObservableQuery "reobserve" the latest data
|
|
1148
|
+
// using a temporary fetch policy of "cache-first", so complete cache
|
|
1149
|
+
// results have a chance to be delivered without triggering additional
|
|
1150
|
+
// network requests, even when options.fetchPolicy is "network-only"
|
|
1151
|
+
// or "cache-and-network". All other fetch policies are preserved by
|
|
1152
|
+
// this method, and are handled by calling oq.reobserve(). If this
|
|
1153
|
+
// reobservation is spurious, distinctUntilChanged still has a
|
|
1154
|
+
// chance to catch it before delivery to ObservableQuery subscribers.
|
|
1155
|
+
this.reobserveCacheFirst();
|
|
1156
|
+
}
|
|
1157
|
+
else {
|
|
1158
|
+
// If this diff came from an optimistic transaction, deliver the
|
|
1159
|
+
// current cache data to the ObservableQuery, but don't perform a
|
|
1160
|
+
// reobservation, since oq.reobserveCacheFirst might make a network
|
|
1161
|
+
// request, and we never want to trigger network requests in the
|
|
1162
|
+
// middle of optimistic updates.
|
|
1163
|
+
this.input.next({
|
|
1164
|
+
kind: "N",
|
|
1165
|
+
value: {
|
|
1166
|
+
data: diff.result,
|
|
1167
|
+
dataState: diff.complete ? "complete"
|
|
1168
|
+
: diff.result ? "partial"
|
|
1169
|
+
: "empty",
|
|
1170
|
+
networkStatus: networkStatus_js_1.NetworkStatus.ready,
|
|
1171
|
+
loading: false,
|
|
1172
|
+
error: undefined,
|
|
1173
|
+
partial: !diff.complete,
|
|
1174
|
+
},
|
|
1175
|
+
source: "cache",
|
|
1176
|
+
query: this.query,
|
|
1177
|
+
variables: this.variables,
|
|
1178
|
+
meta: {},
|
|
1179
|
+
});
|
|
1180
|
+
}
|
|
1181
|
+
}
|
|
1182
|
+
}
|
|
1183
|
+
activeOperations = new Set();
|
|
1184
|
+
pushOperation(networkStatus) {
|
|
1185
|
+
let aborted = false;
|
|
1186
|
+
// track query and variables from the start of the operation
|
|
1187
|
+
const { query, variables } = this;
|
|
1188
|
+
const finalize = () => {
|
|
1189
|
+
this.activeOperations.delete(operation);
|
|
1190
|
+
};
|
|
1191
|
+
const operation = {
|
|
1192
|
+
override: networkStatus,
|
|
1193
|
+
abort: () => {
|
|
1194
|
+
aborted = true;
|
|
1195
|
+
finalize();
|
|
1196
|
+
},
|
|
1197
|
+
query,
|
|
1198
|
+
variables,
|
|
1199
|
+
};
|
|
1200
|
+
this.activeOperations.add(operation);
|
|
1201
|
+
return {
|
|
1202
|
+
finalize,
|
|
1203
|
+
pushNotification: (notification, additionalMeta) => {
|
|
1204
|
+
if (!aborted) {
|
|
1205
|
+
this.input.next({
|
|
1206
|
+
...notification,
|
|
1207
|
+
query,
|
|
1208
|
+
variables,
|
|
1209
|
+
meta: { ...additionalMeta },
|
|
1210
|
+
});
|
|
1211
|
+
}
|
|
1212
|
+
},
|
|
1213
|
+
};
|
|
1214
|
+
}
|
|
1215
|
+
calculateNetworkStatus(baseNetworkStatus) {
|
|
1216
|
+
if (baseNetworkStatus === networkStatus_js_1.NetworkStatus.streaming) {
|
|
1217
|
+
return baseNetworkStatus;
|
|
1218
|
+
}
|
|
1219
|
+
// in the future, this could be more complex logic, e.g. "refetch" and
|
|
1220
|
+
// "fetchMore" having priority over "polling" or "loading" network statuses
|
|
1221
|
+
// as for now we just take the "latest" operation that is still active,
|
|
1222
|
+
// as that lines up best with previous behavior[]
|
|
1223
|
+
const operation = Array.from(this.activeOperations.values())
|
|
1224
|
+
.reverse()
|
|
1225
|
+
.find((operation) => isEqualQuery(operation, this) && operation.override !== undefined);
|
|
1226
|
+
return operation?.override ?? baseNetworkStatus;
|
|
1227
|
+
}
|
|
1228
|
+
abortActiveOperations() {
|
|
1229
|
+
this.activeOperations.forEach((operation) => operation.abort());
|
|
1230
|
+
}
|
|
1231
|
+
/**
|
|
1232
|
+
* @internal
|
|
1233
|
+
* Called from `clearStore`.
|
|
1234
|
+
*
|
|
1235
|
+
* - resets the query to its initial state
|
|
1236
|
+
* - cancels all active operations and their subscriptions
|
|
1237
|
+
*
|
|
1238
|
+
* @deprecated This is an internal API and should not be used directly. This can be removed or changed at any time.
|
|
1239
|
+
*/
|
|
1240
|
+
reset() {
|
|
1241
|
+
// exception for cache-only queries - we reset them into a "ready" state
|
|
1242
|
+
// as we won't trigger a refetch for them
|
|
1243
|
+
const resetToEmpty = this.options.fetchPolicy === "cache-only";
|
|
1244
|
+
this.setResult(resetToEmpty ? empty : uninitialized, {
|
|
1245
|
+
shouldEmit: resetToEmpty ? 1 /* EmitBehavior.force */ : 2 /* EmitBehavior.never */,
|
|
1246
|
+
});
|
|
1247
|
+
this.abortActiveOperations();
|
|
1248
|
+
}
|
|
1249
|
+
/**
|
|
1250
|
+
* @internal
|
|
1251
|
+
*
|
|
1252
|
+
* @deprecated This is an internal API and should not be used directly. This can be removed or changed at any time.
|
|
1253
|
+
*/
|
|
1254
|
+
setResult(result, additionalMeta) {
|
|
1255
|
+
this.input.next({
|
|
1256
|
+
source: "setResult",
|
|
1257
|
+
kind: "N",
|
|
1258
|
+
value: result,
|
|
1259
|
+
query: this.query,
|
|
1260
|
+
variables: this.variables,
|
|
1261
|
+
meta: { ...additionalMeta },
|
|
1262
|
+
});
|
|
1263
|
+
}
|
|
1264
|
+
operator = (0, internal_1.filterMap)((notification) => {
|
|
1265
|
+
const { query, variables, meta } = notification;
|
|
1266
|
+
if (notification.source === "setResult") {
|
|
1267
|
+
return { query, variables, result: notification.value, meta };
|
|
1268
|
+
}
|
|
1269
|
+
if (notification.kind === "C" || !isEqualQuery(notification, this)) {
|
|
1270
|
+
return;
|
|
1271
|
+
}
|
|
1272
|
+
let result;
|
|
1273
|
+
const previous = this.subject.getValue();
|
|
1274
|
+
if (notification.source === "cache") {
|
|
1275
|
+
result = notification.value;
|
|
1276
|
+
if (result.networkStatus === networkStatus_js_1.NetworkStatus.ready &&
|
|
1277
|
+
result.partial &&
|
|
1278
|
+
(!this.options.returnPartialData ||
|
|
1279
|
+
previous.result.networkStatus === networkStatus_js_1.NetworkStatus.error) &&
|
|
1280
|
+
this.options.fetchPolicy !== "cache-only") {
|
|
1281
|
+
return;
|
|
1282
|
+
}
|
|
1283
|
+
}
|
|
1284
|
+
else if (notification.source === "network") {
|
|
1285
|
+
if (this.waitForNetworkResult) {
|
|
1286
|
+
this.waitForNetworkResult = false;
|
|
1287
|
+
this.resubscribeCache();
|
|
1288
|
+
}
|
|
1289
|
+
result =
|
|
1290
|
+
notification.kind === "E" ?
|
|
1291
|
+
{
|
|
1292
|
+
...(isEqualQuery(previous, notification) ?
|
|
1293
|
+
previous.result
|
|
1294
|
+
: { data: undefined, dataState: "empty", partial: true }),
|
|
1295
|
+
error: notification.error,
|
|
1296
|
+
networkStatus: networkStatus_js_1.NetworkStatus.error,
|
|
1297
|
+
loading: false,
|
|
1298
|
+
}
|
|
1299
|
+
: notification.value;
|
|
1300
|
+
if (notification.kind === "E" && result.dataState === "streaming") {
|
|
1301
|
+
result.dataState = "complete";
|
|
1302
|
+
}
|
|
1303
|
+
if (result.error) {
|
|
1304
|
+
meta.shouldEmit = 1 /* EmitBehavior.force */;
|
|
1305
|
+
}
|
|
1306
|
+
}
|
|
1307
|
+
else if (notification.source === "newNetworkStatus") {
|
|
1308
|
+
const baseResult = isEqualQuery(previous, notification) ?
|
|
1309
|
+
previous.result
|
|
1310
|
+
: this.getInitialResult(meta.fetchPolicy);
|
|
1311
|
+
const { resetError } = notification.value;
|
|
1312
|
+
const error = resetError ? undefined : baseResult.error;
|
|
1313
|
+
const networkStatus = error ? networkStatus_js_1.NetworkStatus.error : networkStatus_js_1.NetworkStatus.ready;
|
|
1314
|
+
result = {
|
|
1315
|
+
...baseResult,
|
|
1316
|
+
error,
|
|
1317
|
+
networkStatus,
|
|
1318
|
+
};
|
|
1319
|
+
}
|
|
1320
|
+
// every code path until here should have either returned or set a result,
|
|
1321
|
+
// but typescript needs a little help
|
|
1322
|
+
(0, invariant_1.invariant)(result);
|
|
1323
|
+
// normalize result shape
|
|
1324
|
+
if (!result.error)
|
|
1325
|
+
delete result.error;
|
|
1326
|
+
result.networkStatus = this.calculateNetworkStatus(result.networkStatus);
|
|
1327
|
+
result.loading = (0, utilities_1.isNetworkRequestInFlight)(result.networkStatus);
|
|
1328
|
+
result = this.maskResult(result);
|
|
1329
|
+
return { query, variables, result, meta };
|
|
1330
|
+
});
|
|
1331
|
+
// Reobserve with fetchPolicy effectively set to "cache-first", triggering
|
|
1332
|
+
// delivery of any new data from the cache, possibly falling back to the network
|
|
1333
|
+
// if any cache data are missing. This allows _complete_ cache results to be
|
|
1334
|
+
// delivered without also kicking off unnecessary network requests when
|
|
1335
|
+
// this.options.fetchPolicy is "cache-and-network" or "network-only". When
|
|
1336
|
+
// this.options.fetchPolicy is any other policy ("cache-first", "cache-only",
|
|
1337
|
+
// "standby", or "no-cache"), we call this.reobserve() as usual.
|
|
1338
|
+
reobserveCacheFirst() {
|
|
1339
|
+
const { fetchPolicy, nextFetchPolicy } = this.options;
|
|
1340
|
+
if (fetchPolicy === "cache-and-network" || fetchPolicy === "network-only") {
|
|
1341
|
+
this.reobserve({
|
|
1342
|
+
fetchPolicy: "cache-first",
|
|
1343
|
+
// Use a temporary nextFetchPolicy function that replaces itself with the
|
|
1344
|
+
// previous nextFetchPolicy value and returns the original fetchPolicy.
|
|
1345
|
+
nextFetchPolicy(currentFetchPolicy, context) {
|
|
1346
|
+
// Replace this nextFetchPolicy function in the options object with the
|
|
1347
|
+
// original this.options.nextFetchPolicy value.
|
|
1348
|
+
this.nextFetchPolicy = nextFetchPolicy;
|
|
1349
|
+
// If the original nextFetchPolicy value was a function, give it a
|
|
1350
|
+
// chance to decide what happens here.
|
|
1351
|
+
if (typeof this.nextFetchPolicy === "function") {
|
|
1352
|
+
return this.nextFetchPolicy(currentFetchPolicy, context);
|
|
1353
|
+
}
|
|
1354
|
+
// Otherwise go back to the original this.options.fetchPolicy.
|
|
1355
|
+
return fetchPolicy;
|
|
1356
|
+
},
|
|
1357
|
+
});
|
|
1358
|
+
}
|
|
1359
|
+
else {
|
|
1360
|
+
this.reobserve();
|
|
1361
|
+
}
|
|
1362
|
+
}
|
|
1363
|
+
getVariablesWithDefaults(variables) {
|
|
1364
|
+
return this.queryManager.getVariables(this.query, variables);
|
|
1365
|
+
}
|
|
1366
|
+
}
|
|
1367
|
+
exports.ObservableQuery = ObservableQuery;
|
|
1368
|
+
function logMissingFieldErrors(missing) {
|
|
1369
|
+
if (environment_1.__DEV__ && missing) {
|
|
1370
|
+
__DEV__ && invariant_1.invariant.debug(86, missing);
|
|
1371
|
+
}
|
|
1372
|
+
}
|
|
1373
|
+
function isEqualQuery(a, b) {
|
|
1374
|
+
return !!(a && b && a.query === b.query && (0, equality_1.equal)(a.variables, b.variables));
|
|
1375
|
+
}
|
|
1376
|
+
function getTrackingOperatorPromise(defaultValue) {
|
|
1377
|
+
let lastValue = defaultValue, resolve, reject;
|
|
1378
|
+
const promise = new Promise((res, rej) => {
|
|
1379
|
+
resolve = res;
|
|
1380
|
+
reject = rej;
|
|
1381
|
+
});
|
|
1382
|
+
const operator = (0, rxjs_1.tap)({
|
|
1383
|
+
next(value) {
|
|
1384
|
+
if (value.kind === "E") {
|
|
1385
|
+
return reject(value.error);
|
|
1386
|
+
}
|
|
1387
|
+
if (value.kind === "N" &&
|
|
1388
|
+
value.source !== "newNetworkStatus" &&
|
|
1389
|
+
!value.value.loading) {
|
|
1390
|
+
lastValue = value.value;
|
|
1391
|
+
}
|
|
1392
|
+
},
|
|
1393
|
+
finalize: () => {
|
|
1394
|
+
if (lastValue) {
|
|
1395
|
+
resolve(lastValue);
|
|
1396
|
+
}
|
|
1397
|
+
else {
|
|
1398
|
+
const message = "The operation was aborted.";
|
|
1399
|
+
const name = "AbortError";
|
|
1400
|
+
reject(typeof DOMException !== "undefined" ?
|
|
1401
|
+
new DOMException(message, name)
|
|
1402
|
+
// some environments do not have `DOMException`, e.g. node
|
|
1403
|
+
// uses a normal `Error` with a `name` property instead: https://github.com/phryneas/node/blob/d0579b64f0f6b722f8e49bf8a471dd0d0604a21e/lib/internal/errors.js#L964
|
|
1404
|
+
// error.code is a legacy property that is not used anymore,
|
|
1405
|
+
// and also inconsistent across environments (in supporting
|
|
1406
|
+
// browsers it is `20`, in node `'ABORT_ERR'`) so we omit that.
|
|
1407
|
+
: Object.assign(new Error(message), { name }));
|
|
1408
|
+
}
|
|
1409
|
+
},
|
|
1410
|
+
});
|
|
1411
|
+
return { promise, operator };
|
|
1412
|
+
}
|
|
1413
|
+
//# sourceMappingURL=ObservableQuery.cjs.map
|