@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,1170 @@
|
|
|
1
|
+
"use strict";;
|
|
2
|
+
const {
|
|
3
|
+
__DEV__
|
|
4
|
+
} = require("@apollo/client/utilities/environment");
|
|
5
|
+
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.QueryManager = void 0;
|
|
8
|
+
const trie_1 = require("@wry/trie");
|
|
9
|
+
const graphql_1 = require("graphql");
|
|
10
|
+
const rxjs_1 = require("rxjs");
|
|
11
|
+
const rxjs_2 = require("rxjs");
|
|
12
|
+
const cache_1 = require("@apollo/client/cache");
|
|
13
|
+
const errors_1 = require("@apollo/client/errors");
|
|
14
|
+
const errors_2 = require("@apollo/client/errors");
|
|
15
|
+
const link_1 = require("@apollo/client/link");
|
|
16
|
+
const masking_1 = require("@apollo/client/masking");
|
|
17
|
+
const utilities_1 = require("@apollo/client/utilities");
|
|
18
|
+
const environment_1 = require("@apollo/client/utilities/environment");
|
|
19
|
+
const internal_1 = require("@apollo/client/utilities/internal");
|
|
20
|
+
const invariant_1 = require("@apollo/client/utilities/invariant");
|
|
21
|
+
const networkStatus_js_1 = require("./networkStatus.cjs");
|
|
22
|
+
const ObservableQuery_js_1 = require("./ObservableQuery.cjs");
|
|
23
|
+
const QueryInfo_js_1 = require("./QueryInfo.cjs");
|
|
24
|
+
class QueryManager {
|
|
25
|
+
defaultOptions;
|
|
26
|
+
client;
|
|
27
|
+
/**
|
|
28
|
+
* The options that were passed to the ApolloClient constructor.
|
|
29
|
+
*/
|
|
30
|
+
clientOptions;
|
|
31
|
+
assumeImmutableResults;
|
|
32
|
+
documentTransform;
|
|
33
|
+
ssrMode;
|
|
34
|
+
defaultContext;
|
|
35
|
+
dataMasking;
|
|
36
|
+
incrementalHandler;
|
|
37
|
+
localState;
|
|
38
|
+
queryDeduplication;
|
|
39
|
+
/**
|
|
40
|
+
* Whether to prioritize cache values over network results when
|
|
41
|
+
* `fetchObservableWithInfo` is called.
|
|
42
|
+
* This will essentially turn a `"network-only"` or `"cache-and-network"`
|
|
43
|
+
* fetchPolicy into a `"cache-first"` fetchPolicy, but without influencing
|
|
44
|
+
* the `fetchPolicy` of the `ObservableQuery`.
|
|
45
|
+
*
|
|
46
|
+
* This can e.g. be used to prioritize the cache during the first render after
|
|
47
|
+
* SSR.
|
|
48
|
+
*/
|
|
49
|
+
prioritizeCacheValues = false;
|
|
50
|
+
onBroadcast;
|
|
51
|
+
mutationStore;
|
|
52
|
+
/**
|
|
53
|
+
* All ObservableQueries that currently have at least one subscriber.
|
|
54
|
+
*/
|
|
55
|
+
obsQueries = new Set();
|
|
56
|
+
// Maps from queryInfo.id strings to Promise rejection functions for
|
|
57
|
+
// currently active queries and fetches.
|
|
58
|
+
// Use protected instead of private field so
|
|
59
|
+
// @apollo/experimental-nextjs-app-support can access type info.
|
|
60
|
+
fetchCancelFns = new Map();
|
|
61
|
+
constructor(options) {
|
|
62
|
+
const defaultDocumentTransform = new utilities_1.DocumentTransform((document) => this.cache.transformDocument(document),
|
|
63
|
+
// Allow the apollo cache to manage its own transform caches
|
|
64
|
+
{ cache: false });
|
|
65
|
+
this.client = options.client;
|
|
66
|
+
this.defaultOptions = options.defaultOptions;
|
|
67
|
+
this.queryDeduplication = options.queryDeduplication;
|
|
68
|
+
this.clientOptions = options.clientOptions;
|
|
69
|
+
this.ssrMode = options.ssrMode;
|
|
70
|
+
this.assumeImmutableResults = options.assumeImmutableResults;
|
|
71
|
+
this.dataMasking = options.dataMasking;
|
|
72
|
+
this.localState = options.localState;
|
|
73
|
+
this.incrementalHandler = options.incrementalHandler;
|
|
74
|
+
const documentTransform = options.documentTransform;
|
|
75
|
+
this.documentTransform =
|
|
76
|
+
documentTransform ?
|
|
77
|
+
defaultDocumentTransform
|
|
78
|
+
.concat(documentTransform)
|
|
79
|
+
// The custom document transform may add new fragment spreads or new
|
|
80
|
+
// field selections, so we want to give the cache a chance to run
|
|
81
|
+
// again. For example, the InMemoryCache adds __typename to field
|
|
82
|
+
// selections and fragments from the fragment registry.
|
|
83
|
+
.concat(defaultDocumentTransform)
|
|
84
|
+
: defaultDocumentTransform;
|
|
85
|
+
this.defaultContext = options.defaultContext || {};
|
|
86
|
+
if ((this.onBroadcast = options.onBroadcast)) {
|
|
87
|
+
this.mutationStore = {};
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
get link() {
|
|
91
|
+
return this.client.link;
|
|
92
|
+
}
|
|
93
|
+
get cache() {
|
|
94
|
+
return this.client.cache;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Call this method to terminate any active query processes, making it safe
|
|
98
|
+
* to dispose of this QueryManager instance.
|
|
99
|
+
*/
|
|
100
|
+
stop() {
|
|
101
|
+
this.obsQueries.forEach((oq) => oq.stop());
|
|
102
|
+
this.cancelPendingFetches((0, invariant_1.newInvariantError)(87));
|
|
103
|
+
}
|
|
104
|
+
cancelPendingFetches(error) {
|
|
105
|
+
this.fetchCancelFns.forEach((cancel) => cancel(error));
|
|
106
|
+
this.fetchCancelFns.clear();
|
|
107
|
+
}
|
|
108
|
+
async mutate({ mutation, variables, optimisticResponse, updateQueries, refetchQueries = [], awaitRefetchQueries = false, update: updateWithProxyFn, onQueryUpdated, fetchPolicy, errorPolicy, keepRootFields, context, }) {
|
|
109
|
+
const queryInfo = new QueryInfo_js_1.QueryInfo(this);
|
|
110
|
+
mutation = this.cache.transformForLink(this.transform(mutation));
|
|
111
|
+
const { hasClientExports } = this.getDocumentInfo(mutation);
|
|
112
|
+
variables = this.getVariables(mutation, variables);
|
|
113
|
+
if (hasClientExports) {
|
|
114
|
+
if (environment_1.__DEV__) {
|
|
115
|
+
(0, invariant_1.invariant)(
|
|
116
|
+
this.localState,
|
|
117
|
+
88,
|
|
118
|
+
(0, internal_1.getOperationName)(mutation, "(anonymous)")
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
variables = await this.localState.getExportedVariables({
|
|
122
|
+
client: this.client,
|
|
123
|
+
document: mutation,
|
|
124
|
+
variables,
|
|
125
|
+
context,
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
const mutationStoreValue = this.mutationStore &&
|
|
129
|
+
(this.mutationStore[queryInfo.id] = {
|
|
130
|
+
mutation,
|
|
131
|
+
variables,
|
|
132
|
+
loading: true,
|
|
133
|
+
error: null,
|
|
134
|
+
});
|
|
135
|
+
const isOptimistic = optimisticResponse &&
|
|
136
|
+
queryInfo.markMutationOptimistic(optimisticResponse, {
|
|
137
|
+
document: mutation,
|
|
138
|
+
variables,
|
|
139
|
+
cacheWriteBehavior: fetchPolicy === "no-cache" ?
|
|
140
|
+
0 /* CacheWriteBehavior.FORBID */
|
|
141
|
+
: 2 /* CacheWriteBehavior.MERGE */,
|
|
142
|
+
errorPolicy,
|
|
143
|
+
context,
|
|
144
|
+
updateQueries,
|
|
145
|
+
update: updateWithProxyFn,
|
|
146
|
+
keepRootFields,
|
|
147
|
+
});
|
|
148
|
+
this.broadcastQueries();
|
|
149
|
+
return new Promise((resolve, reject) => {
|
|
150
|
+
const cause = {};
|
|
151
|
+
return this.getObservableFromLink(mutation, {
|
|
152
|
+
...context,
|
|
153
|
+
optimisticResponse: isOptimistic ? optimisticResponse : void 0,
|
|
154
|
+
}, variables, fetchPolicy, {}, false)
|
|
155
|
+
.observable.pipe(validateDidEmitValue(), (0, rxjs_2.mergeMap)((result) => {
|
|
156
|
+
const storeResult = { ...result };
|
|
157
|
+
return (0, rxjs_2.from)(queryInfo.markMutationResult(storeResult, {
|
|
158
|
+
document: mutation,
|
|
159
|
+
variables,
|
|
160
|
+
cacheWriteBehavior: fetchPolicy === "no-cache" ?
|
|
161
|
+
0 /* CacheWriteBehavior.FORBID */
|
|
162
|
+
: 2 /* CacheWriteBehavior.MERGE */,
|
|
163
|
+
errorPolicy,
|
|
164
|
+
context,
|
|
165
|
+
update: updateWithProxyFn,
|
|
166
|
+
updateQueries,
|
|
167
|
+
awaitRefetchQueries,
|
|
168
|
+
refetchQueries,
|
|
169
|
+
removeOptimistic: isOptimistic ? queryInfo.id : void 0,
|
|
170
|
+
onQueryUpdated,
|
|
171
|
+
keepRootFields,
|
|
172
|
+
}));
|
|
173
|
+
}))
|
|
174
|
+
.pipe((0, rxjs_2.map)((storeResult) => {
|
|
175
|
+
const hasErrors = (0, internal_1.graphQLResultHasError)(storeResult);
|
|
176
|
+
if (hasErrors && errorPolicy === "none") {
|
|
177
|
+
throw new errors_1.CombinedGraphQLErrors(removeStreamDetailsFromExtensions(storeResult));
|
|
178
|
+
}
|
|
179
|
+
if (mutationStoreValue) {
|
|
180
|
+
mutationStoreValue.loading = false;
|
|
181
|
+
mutationStoreValue.error = null;
|
|
182
|
+
}
|
|
183
|
+
return storeResult;
|
|
184
|
+
}))
|
|
185
|
+
.subscribe({
|
|
186
|
+
next: (storeResult) => {
|
|
187
|
+
this.broadcastQueries();
|
|
188
|
+
// Since mutations might receive multiple payloads from the
|
|
189
|
+
// ApolloLink chain (e.g. when used with @defer),
|
|
190
|
+
// we resolve with a SingleExecutionResult or after the final
|
|
191
|
+
// ExecutionPatchResult has arrived and we have assembled the
|
|
192
|
+
// multipart response into a single result.
|
|
193
|
+
if (!queryInfo.hasNext) {
|
|
194
|
+
const result = {
|
|
195
|
+
data: this.maskOperation({
|
|
196
|
+
document: mutation,
|
|
197
|
+
data: storeResult.data,
|
|
198
|
+
fetchPolicy,
|
|
199
|
+
cause,
|
|
200
|
+
}),
|
|
201
|
+
};
|
|
202
|
+
if ((0, internal_1.graphQLResultHasError)(storeResult)) {
|
|
203
|
+
result.error = new errors_1.CombinedGraphQLErrors(storeResult);
|
|
204
|
+
}
|
|
205
|
+
if (Object.keys(storeResult.extensions || {}).length) {
|
|
206
|
+
result.extensions = storeResult.extensions;
|
|
207
|
+
}
|
|
208
|
+
resolve(result);
|
|
209
|
+
}
|
|
210
|
+
},
|
|
211
|
+
error: (error) => {
|
|
212
|
+
if (mutationStoreValue) {
|
|
213
|
+
mutationStoreValue.loading = false;
|
|
214
|
+
mutationStoreValue.error = error;
|
|
215
|
+
}
|
|
216
|
+
if (isOptimistic) {
|
|
217
|
+
this.cache.removeOptimistic(queryInfo.id);
|
|
218
|
+
}
|
|
219
|
+
this.broadcastQueries();
|
|
220
|
+
if (errorPolicy === "ignore") {
|
|
221
|
+
return resolve({ data: undefined });
|
|
222
|
+
}
|
|
223
|
+
if (errorPolicy === "all") {
|
|
224
|
+
return resolve({ data: undefined, error });
|
|
225
|
+
}
|
|
226
|
+
reject(error);
|
|
227
|
+
},
|
|
228
|
+
});
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
fetchQuery(options, networkStatus) {
|
|
232
|
+
(0, internal_1.checkDocument)(options.query, graphql_1.OperationTypeNode.QUERY);
|
|
233
|
+
// do the rest asynchronously to keep the same rejection timing as
|
|
234
|
+
// checks further in `.mutate`
|
|
235
|
+
return (async () => (0, rxjs_2.lastValueFrom)(this.fetchObservableWithInfo(options, {
|
|
236
|
+
networkStatus,
|
|
237
|
+
}).observable.pipe((0, internal_1.filterMap)((value) => {
|
|
238
|
+
switch (value.kind) {
|
|
239
|
+
case "E":
|
|
240
|
+
throw value.error;
|
|
241
|
+
case "N": {
|
|
242
|
+
if (value.source !== "newNetworkStatus")
|
|
243
|
+
return (0, internal_1.toQueryResult)(value.value);
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
})), {
|
|
247
|
+
// This default is needed when a `standby` fetch policy is used to avoid
|
|
248
|
+
// an EmptyError from rejecting this promise.
|
|
249
|
+
defaultValue: { data: undefined },
|
|
250
|
+
}))();
|
|
251
|
+
}
|
|
252
|
+
transform(document) {
|
|
253
|
+
return this.documentTransform.transformDocument(document);
|
|
254
|
+
}
|
|
255
|
+
transformCache = new internal_1.AutoCleanedWeakCache(utilities_1.cacheSizes["queryManager.getDocumentInfo"] ||
|
|
256
|
+
2000 /* defaultCacheSizes["queryManager.getDocumentInfo"] */);
|
|
257
|
+
getDocumentInfo(document) {
|
|
258
|
+
const { transformCache } = this;
|
|
259
|
+
if (!transformCache.has(document)) {
|
|
260
|
+
const operationDefinition = (0, internal_1.getOperationDefinition)(document);
|
|
261
|
+
const cacheEntry = {
|
|
262
|
+
// TODO These three calls (hasClientExports, shouldForceResolvers, and
|
|
263
|
+
// usesNonreactiveDirective) are performing independent full traversals
|
|
264
|
+
// of the transformed document. We should consider merging these
|
|
265
|
+
// traversals into a single pass in the future, though the work is
|
|
266
|
+
// cached after the first time.
|
|
267
|
+
hasClientExports: (0, internal_1.hasDirectives)(["client", "export"], document, true),
|
|
268
|
+
hasForcedResolvers: (0, internal_1.hasForcedResolvers)(document),
|
|
269
|
+
hasNonreactiveDirective: (0, internal_1.hasDirectives)(["nonreactive"], document),
|
|
270
|
+
hasIncrementalDirective: (0, internal_1.hasDirectives)(["defer"], document),
|
|
271
|
+
nonReactiveQuery: addNonReactiveToNamedFragments(document),
|
|
272
|
+
clientQuery: (0, internal_1.hasDirectives)(["client"], document) ? document : null,
|
|
273
|
+
serverQuery: (0, internal_1.removeDirectivesFromDocument)([
|
|
274
|
+
{ name: "client", remove: true },
|
|
275
|
+
{ name: "connection" },
|
|
276
|
+
{ name: "nonreactive" },
|
|
277
|
+
{ name: "unmask" },
|
|
278
|
+
], document),
|
|
279
|
+
operationType: operationDefinition?.operation,
|
|
280
|
+
defaultVars: (0, internal_1.getDefaultValues)(operationDefinition),
|
|
281
|
+
// Transform any mutation or subscription operations to query operations
|
|
282
|
+
// so we can read/write them from/to the cache.
|
|
283
|
+
asQuery: {
|
|
284
|
+
...document,
|
|
285
|
+
definitions: document.definitions.map((def) => {
|
|
286
|
+
if (def.kind === "OperationDefinition" &&
|
|
287
|
+
def.operation !== "query") {
|
|
288
|
+
return { ...def, operation: "query" };
|
|
289
|
+
}
|
|
290
|
+
return def;
|
|
291
|
+
}),
|
|
292
|
+
},
|
|
293
|
+
};
|
|
294
|
+
transformCache.set(document, cacheEntry);
|
|
295
|
+
}
|
|
296
|
+
const entry = transformCache.get(document);
|
|
297
|
+
if (entry.violation) {
|
|
298
|
+
throw entry.violation;
|
|
299
|
+
}
|
|
300
|
+
return entry;
|
|
301
|
+
}
|
|
302
|
+
getVariables(document, variables) {
|
|
303
|
+
const defaultVars = this.getDocumentInfo(document).defaultVars;
|
|
304
|
+
const varsWithDefaults = Object.entries(variables ?? {}).map(([key, value]) => [key, value === undefined ? defaultVars[key] : value]);
|
|
305
|
+
return {
|
|
306
|
+
...defaultVars,
|
|
307
|
+
...Object.fromEntries(varsWithDefaults),
|
|
308
|
+
};
|
|
309
|
+
}
|
|
310
|
+
watchQuery(options) {
|
|
311
|
+
(0, internal_1.checkDocument)(options.query, graphql_1.OperationTypeNode.QUERY);
|
|
312
|
+
const query = this.transform(options.query);
|
|
313
|
+
// assign variable default values if supplied
|
|
314
|
+
// NOTE: We don't modify options.query here with the transformed query to
|
|
315
|
+
// ensure observable.options.query is set to the raw untransformed query.
|
|
316
|
+
options = {
|
|
317
|
+
...options,
|
|
318
|
+
variables: this.getVariables(query, options.variables),
|
|
319
|
+
};
|
|
320
|
+
if (typeof options.notifyOnNetworkStatusChange === "undefined") {
|
|
321
|
+
options.notifyOnNetworkStatusChange = true;
|
|
322
|
+
}
|
|
323
|
+
const observable = new ObservableQuery_js_1.ObservableQuery({
|
|
324
|
+
queryManager: this,
|
|
325
|
+
options,
|
|
326
|
+
transformedQuery: query,
|
|
327
|
+
});
|
|
328
|
+
return observable;
|
|
329
|
+
}
|
|
330
|
+
query(options) {
|
|
331
|
+
const query = this.transform(options.query);
|
|
332
|
+
return this.fetchQuery({
|
|
333
|
+
...options,
|
|
334
|
+
query,
|
|
335
|
+
}).then((value) => ({
|
|
336
|
+
...value,
|
|
337
|
+
data: this.maskOperation({
|
|
338
|
+
document: query,
|
|
339
|
+
data: value?.data,
|
|
340
|
+
fetchPolicy: options.fetchPolicy,
|
|
341
|
+
}),
|
|
342
|
+
}));
|
|
343
|
+
}
|
|
344
|
+
requestIdCounter = 1;
|
|
345
|
+
generateRequestId() {
|
|
346
|
+
return this.requestIdCounter++;
|
|
347
|
+
}
|
|
348
|
+
clearStore(options = {
|
|
349
|
+
discardWatches: true,
|
|
350
|
+
}) {
|
|
351
|
+
// Before we have sent the reset action to the store, we can no longer
|
|
352
|
+
// rely on the results returned by in-flight requests since these may
|
|
353
|
+
// depend on values that previously existed in the data portion of the
|
|
354
|
+
// store. So, we cancel the promises and observers that we have issued
|
|
355
|
+
// so far and not yet resolved (in the case of queries).
|
|
356
|
+
this.cancelPendingFetches((0, invariant_1.newInvariantError)(89));
|
|
357
|
+
this.obsQueries.forEach((observableQuery) => {
|
|
358
|
+
// Set loading to true so listeners don't trigger unless they want
|
|
359
|
+
// results with partial data.
|
|
360
|
+
observableQuery.reset();
|
|
361
|
+
});
|
|
362
|
+
if (this.mutationStore) {
|
|
363
|
+
this.mutationStore = {};
|
|
364
|
+
}
|
|
365
|
+
// begin removing data from the store
|
|
366
|
+
return this.cache.reset(options);
|
|
367
|
+
}
|
|
368
|
+
getObservableQueries(include = "active") {
|
|
369
|
+
const queries = new Set();
|
|
370
|
+
const queryNames = new Map();
|
|
371
|
+
const queryNamesAndQueryStrings = new Map();
|
|
372
|
+
const legacyQueryOptions = new Set();
|
|
373
|
+
if (Array.isArray(include)) {
|
|
374
|
+
include.forEach((desc) => {
|
|
375
|
+
if (typeof desc === "string") {
|
|
376
|
+
queryNames.set(desc, desc);
|
|
377
|
+
queryNamesAndQueryStrings.set(desc, false);
|
|
378
|
+
}
|
|
379
|
+
else if ((0, internal_1.isDocumentNode)(desc)) {
|
|
380
|
+
const queryString = (0, utilities_1.print)(this.transform(desc));
|
|
381
|
+
queryNames.set(queryString, (0, internal_1.getOperationName)(desc));
|
|
382
|
+
queryNamesAndQueryStrings.set(queryString, false);
|
|
383
|
+
}
|
|
384
|
+
else if ((0, internal_1.isNonNullObject)(desc) && desc.query) {
|
|
385
|
+
legacyQueryOptions.add(desc);
|
|
386
|
+
}
|
|
387
|
+
});
|
|
388
|
+
}
|
|
389
|
+
this.obsQueries.forEach((oq) => {
|
|
390
|
+
const document = (0, utilities_1.print)(this.transform(oq.options.query));
|
|
391
|
+
if (include === "all") {
|
|
392
|
+
queries.add(oq);
|
|
393
|
+
return;
|
|
394
|
+
}
|
|
395
|
+
const { queryName, options: { fetchPolicy }, } = oq;
|
|
396
|
+
if (include === "active" && fetchPolicy === "standby") {
|
|
397
|
+
return;
|
|
398
|
+
}
|
|
399
|
+
if (include === "active" ||
|
|
400
|
+
(queryName && queryNamesAndQueryStrings.has(queryName)) ||
|
|
401
|
+
(document && queryNamesAndQueryStrings.has(document))) {
|
|
402
|
+
queries.add(oq);
|
|
403
|
+
if (queryName)
|
|
404
|
+
queryNamesAndQueryStrings.set(queryName, true);
|
|
405
|
+
if (document)
|
|
406
|
+
queryNamesAndQueryStrings.set(document, true);
|
|
407
|
+
}
|
|
408
|
+
});
|
|
409
|
+
if (legacyQueryOptions.size) {
|
|
410
|
+
legacyQueryOptions.forEach((options) => {
|
|
411
|
+
const oq = new ObservableQuery_js_1.ObservableQuery({
|
|
412
|
+
queryManager: this,
|
|
413
|
+
options: {
|
|
414
|
+
...(0, internal_1.mergeOptions)(this.defaultOptions.watchQuery, options),
|
|
415
|
+
fetchPolicy: "network-only",
|
|
416
|
+
},
|
|
417
|
+
});
|
|
418
|
+
queries.add(oq);
|
|
419
|
+
});
|
|
420
|
+
}
|
|
421
|
+
if (environment_1.__DEV__ && queryNamesAndQueryStrings.size) {
|
|
422
|
+
queryNamesAndQueryStrings.forEach((included, nameOrQueryString) => {
|
|
423
|
+
if (!included) {
|
|
424
|
+
const queryName = queryNames.get(nameOrQueryString);
|
|
425
|
+
if (queryName) {
|
|
426
|
+
__DEV__ && invariant_1.invariant.warn(90, queryName);
|
|
427
|
+
}
|
|
428
|
+
else {
|
|
429
|
+
__DEV__ && invariant_1.invariant.warn(91);
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
});
|
|
433
|
+
}
|
|
434
|
+
return queries;
|
|
435
|
+
}
|
|
436
|
+
refetchObservableQueries(includeStandby = false) {
|
|
437
|
+
const observableQueryPromises = [];
|
|
438
|
+
this.getObservableQueries(includeStandby ? "all" : "active").forEach((observableQuery) => {
|
|
439
|
+
const { fetchPolicy } = observableQuery.options;
|
|
440
|
+
if ((includeStandby || fetchPolicy !== "standby") &&
|
|
441
|
+
fetchPolicy !== "cache-only") {
|
|
442
|
+
observableQueryPromises.push(observableQuery.refetch());
|
|
443
|
+
}
|
|
444
|
+
});
|
|
445
|
+
this.broadcastQueries();
|
|
446
|
+
return Promise.all(observableQueryPromises);
|
|
447
|
+
}
|
|
448
|
+
startGraphQLSubscription(options) {
|
|
449
|
+
let { query, variables } = options;
|
|
450
|
+
const { fetchPolicy = "cache-first", errorPolicy = "none", context = {}, extensions = {}, } = options;
|
|
451
|
+
(0, internal_1.checkDocument)(query, graphql_1.OperationTypeNode.SUBSCRIPTION);
|
|
452
|
+
query = this.transform(query);
|
|
453
|
+
variables = this.getVariables(query, variables);
|
|
454
|
+
let restart;
|
|
455
|
+
if (environment_1.__DEV__) {
|
|
456
|
+
(0, invariant_1.invariant)(
|
|
457
|
+
!this.getDocumentInfo(query).hasClientExports || this.localState,
|
|
458
|
+
92,
|
|
459
|
+
(0, internal_1.getOperationName)(query, "(anonymous)")
|
|
460
|
+
);
|
|
461
|
+
}
|
|
462
|
+
const observable = (this.getDocumentInfo(query).hasClientExports ?
|
|
463
|
+
(0, rxjs_2.from)(this.localState.getExportedVariables({
|
|
464
|
+
client: this.client,
|
|
465
|
+
document: query,
|
|
466
|
+
variables,
|
|
467
|
+
context,
|
|
468
|
+
}))
|
|
469
|
+
: (0, rxjs_2.of)(variables)).pipe((0, rxjs_2.mergeMap)((variables) => {
|
|
470
|
+
const { observable, restart: res } = this.getObservableFromLink(query, context, variables, fetchPolicy, extensions);
|
|
471
|
+
const queryInfo = new QueryInfo_js_1.QueryInfo(this);
|
|
472
|
+
restart = res;
|
|
473
|
+
return observable.pipe((0, rxjs_2.map)((rawResult) => {
|
|
474
|
+
queryInfo.markSubscriptionResult(rawResult, {
|
|
475
|
+
document: query,
|
|
476
|
+
variables,
|
|
477
|
+
errorPolicy,
|
|
478
|
+
cacheWriteBehavior: fetchPolicy === "no-cache" ?
|
|
479
|
+
0 /* CacheWriteBehavior.FORBID */
|
|
480
|
+
: 2 /* CacheWriteBehavior.MERGE */,
|
|
481
|
+
});
|
|
482
|
+
const result = {
|
|
483
|
+
data: rawResult.data ?? undefined,
|
|
484
|
+
};
|
|
485
|
+
if ((0, internal_1.graphQLResultHasError)(rawResult)) {
|
|
486
|
+
result.error = new errors_1.CombinedGraphQLErrors(rawResult);
|
|
487
|
+
}
|
|
488
|
+
else if ((0, errors_1.graphQLResultHasProtocolErrors)(rawResult)) {
|
|
489
|
+
result.error = rawResult.extensions[errors_2.PROTOCOL_ERRORS_SYMBOL];
|
|
490
|
+
// Don't emit protocol errors added by HttpLink
|
|
491
|
+
delete rawResult.extensions[errors_2.PROTOCOL_ERRORS_SYMBOL];
|
|
492
|
+
}
|
|
493
|
+
if (rawResult.extensions &&
|
|
494
|
+
Object.keys(rawResult.extensions).length) {
|
|
495
|
+
result.extensions = rawResult.extensions;
|
|
496
|
+
}
|
|
497
|
+
if (result.error && errorPolicy === "none") {
|
|
498
|
+
result.data = undefined;
|
|
499
|
+
}
|
|
500
|
+
if (errorPolicy === "ignore") {
|
|
501
|
+
delete result.error;
|
|
502
|
+
}
|
|
503
|
+
return result;
|
|
504
|
+
}), (0, rxjs_2.catchError)((error) => {
|
|
505
|
+
if (errorPolicy === "ignore") {
|
|
506
|
+
return (0, rxjs_2.of)({
|
|
507
|
+
data: undefined,
|
|
508
|
+
});
|
|
509
|
+
}
|
|
510
|
+
return (0, rxjs_2.of)({ data: undefined, error });
|
|
511
|
+
}), (0, rxjs_2.filter)((result) => !!(result.data || result.error)));
|
|
512
|
+
}));
|
|
513
|
+
return Object.assign(observable, { restart: () => restart?.() });
|
|
514
|
+
}
|
|
515
|
+
broadcastQueries() {
|
|
516
|
+
if (this.onBroadcast)
|
|
517
|
+
this.onBroadcast();
|
|
518
|
+
this.obsQueries.forEach((observableQuery) => observableQuery.notify());
|
|
519
|
+
}
|
|
520
|
+
// Use protected instead of private field so
|
|
521
|
+
// @apollo/experimental-nextjs-app-support can access type info.
|
|
522
|
+
inFlightLinkObservables = new trie_1.Trie(false);
|
|
523
|
+
getObservableFromLink(query, context, variables, fetchPolicy, extensions,
|
|
524
|
+
// Prefer context.queryDeduplication if specified.
|
|
525
|
+
deduplication = context?.queryDeduplication ??
|
|
526
|
+
this.queryDeduplication) {
|
|
527
|
+
let entry = {};
|
|
528
|
+
const { serverQuery, clientQuery, operationType, hasIncrementalDirective } = this.getDocumentInfo(query);
|
|
529
|
+
const operationName = (0, internal_1.getOperationName)(query);
|
|
530
|
+
const executeContext = {
|
|
531
|
+
client: this.client,
|
|
532
|
+
};
|
|
533
|
+
if (serverQuery) {
|
|
534
|
+
const { inFlightLinkObservables, link } = this;
|
|
535
|
+
try {
|
|
536
|
+
const operation = this.incrementalHandler.prepareRequest({
|
|
537
|
+
query: serverQuery,
|
|
538
|
+
variables,
|
|
539
|
+
context: {
|
|
540
|
+
...this.defaultContext,
|
|
541
|
+
...context,
|
|
542
|
+
queryDeduplication: deduplication,
|
|
543
|
+
},
|
|
544
|
+
extensions,
|
|
545
|
+
});
|
|
546
|
+
context = operation.context;
|
|
547
|
+
function withRestart(source) {
|
|
548
|
+
return new rxjs_1.Observable((observer) => {
|
|
549
|
+
function subscribe() {
|
|
550
|
+
return source.subscribe({
|
|
551
|
+
next: observer.next.bind(observer),
|
|
552
|
+
complete: observer.complete.bind(observer),
|
|
553
|
+
error: observer.error.bind(observer),
|
|
554
|
+
});
|
|
555
|
+
}
|
|
556
|
+
let subscription = subscribe();
|
|
557
|
+
entry.restart ||= () => {
|
|
558
|
+
subscription.unsubscribe();
|
|
559
|
+
subscription = subscribe();
|
|
560
|
+
};
|
|
561
|
+
return () => {
|
|
562
|
+
subscription.unsubscribe();
|
|
563
|
+
entry.restart = undefined;
|
|
564
|
+
};
|
|
565
|
+
});
|
|
566
|
+
}
|
|
567
|
+
if (deduplication) {
|
|
568
|
+
const printedServerQuery = (0, utilities_1.print)(serverQuery);
|
|
569
|
+
const varJson = (0, cache_1.canonicalStringify)(variables);
|
|
570
|
+
entry = inFlightLinkObservables.lookup(printedServerQuery, varJson);
|
|
571
|
+
if (!entry.observable) {
|
|
572
|
+
entry.observable = (0, link_1.execute)(link, operation, executeContext).pipe(withRestart, (0, rxjs_2.finalize)(() => {
|
|
573
|
+
if (inFlightLinkObservables.peek(printedServerQuery, varJson) ===
|
|
574
|
+
entry) {
|
|
575
|
+
inFlightLinkObservables.remove(printedServerQuery, varJson);
|
|
576
|
+
}
|
|
577
|
+
}),
|
|
578
|
+
// We don't want to replay the last emitted value for
|
|
579
|
+
// subscriptions and instead opt to wait to receive updates until
|
|
580
|
+
// the subscription emits new values.
|
|
581
|
+
operationType === graphql_1.OperationTypeNode.SUBSCRIPTION ?
|
|
582
|
+
(0, rxjs_2.share)()
|
|
583
|
+
: (0, rxjs_2.shareReplay)({ refCount: true }));
|
|
584
|
+
}
|
|
585
|
+
}
|
|
586
|
+
else {
|
|
587
|
+
entry.observable = (0, link_1.execute)(link, operation, executeContext).pipe(withRestart);
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
catch (error) {
|
|
591
|
+
entry.observable = (0, rxjs_1.throwError)(() => error);
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
else {
|
|
595
|
+
entry.observable = (0, rxjs_2.of)({ data: {} });
|
|
596
|
+
}
|
|
597
|
+
if (clientQuery) {
|
|
598
|
+
const { operation } = (0, internal_1.getOperationDefinition)(query);
|
|
599
|
+
if (environment_1.__DEV__) {
|
|
600
|
+
(0, invariant_1.invariant)(
|
|
601
|
+
this.localState,
|
|
602
|
+
93,
|
|
603
|
+
operation[0].toUpperCase() + operation.slice(1),
|
|
604
|
+
operationName ?? "(anonymous)"
|
|
605
|
+
);
|
|
606
|
+
}
|
|
607
|
+
(0, invariant_1.invariant)(
|
|
608
|
+
!hasIncrementalDirective,
|
|
609
|
+
94,
|
|
610
|
+
operation[0].toUpperCase() + operation.slice(1),
|
|
611
|
+
operationName ?? "(anonymous)"
|
|
612
|
+
);
|
|
613
|
+
entry.observable = entry.observable.pipe((0, rxjs_2.mergeMap)((result) => {
|
|
614
|
+
return (0, rxjs_2.from)(this.localState.execute({
|
|
615
|
+
client: this.client,
|
|
616
|
+
document: clientQuery,
|
|
617
|
+
remoteResult: result,
|
|
618
|
+
context,
|
|
619
|
+
variables,
|
|
620
|
+
fetchPolicy,
|
|
621
|
+
}));
|
|
622
|
+
}));
|
|
623
|
+
}
|
|
624
|
+
return {
|
|
625
|
+
restart: () => entry.restart?.(),
|
|
626
|
+
observable: entry.observable.pipe((0, rxjs_2.catchError)((error) => {
|
|
627
|
+
error = (0, errors_1.toErrorLike)(error);
|
|
628
|
+
(0, errors_1.registerLinkError)(error);
|
|
629
|
+
throw error;
|
|
630
|
+
})),
|
|
631
|
+
};
|
|
632
|
+
}
|
|
633
|
+
getResultsFromLink(options, { queryInfo, cacheWriteBehavior, observableQuery, exposeExtensions, }) {
|
|
634
|
+
const requestId = (queryInfo.lastRequestId = this.generateRequestId());
|
|
635
|
+
const { errorPolicy } = options;
|
|
636
|
+
// Performing transformForLink here gives this.cache a chance to fill in
|
|
637
|
+
// missing fragment definitions (for example) before sending this document
|
|
638
|
+
// through the link chain.
|
|
639
|
+
const linkDocument = this.cache.transformForLink(options.query);
|
|
640
|
+
return this.getObservableFromLink(linkDocument, options.context, options.variables, options.fetchPolicy).observable.pipe((0, rxjs_2.map)((incoming) => {
|
|
641
|
+
// Use linkDocument rather than queryInfo.document so the
|
|
642
|
+
// operation/fragments used to write the result are the same as the
|
|
643
|
+
// ones used to obtain it from the link.
|
|
644
|
+
const result = queryInfo.markQueryResult(incoming, {
|
|
645
|
+
...options,
|
|
646
|
+
document: linkDocument,
|
|
647
|
+
cacheWriteBehavior,
|
|
648
|
+
});
|
|
649
|
+
const hasErrors = (0, internal_1.graphQLResultHasError)(result);
|
|
650
|
+
if (hasErrors && errorPolicy === "none") {
|
|
651
|
+
queryInfo.resetLastWrite();
|
|
652
|
+
observableQuery?.["resetNotifications"]();
|
|
653
|
+
throw new errors_1.CombinedGraphQLErrors(removeStreamDetailsFromExtensions(result));
|
|
654
|
+
}
|
|
655
|
+
const aqr = {
|
|
656
|
+
data: result.data,
|
|
657
|
+
...(queryInfo.hasNext ?
|
|
658
|
+
{
|
|
659
|
+
loading: true,
|
|
660
|
+
networkStatus: networkStatus_js_1.NetworkStatus.streaming,
|
|
661
|
+
dataState: "streaming",
|
|
662
|
+
partial: true,
|
|
663
|
+
}
|
|
664
|
+
: {
|
|
665
|
+
dataState: result.data ? "complete" : "empty",
|
|
666
|
+
loading: false,
|
|
667
|
+
networkStatus: networkStatus_js_1.NetworkStatus.ready,
|
|
668
|
+
partial: !result.data,
|
|
669
|
+
}),
|
|
670
|
+
};
|
|
671
|
+
if (exposeExtensions && "extensions" in result) {
|
|
672
|
+
aqr[internal_1.extensionsSymbol] = result.extensions;
|
|
673
|
+
}
|
|
674
|
+
// In the case we start multiple network requests simultaneously, we
|
|
675
|
+
// want to ensure we properly set `data` if we're reporting on an old
|
|
676
|
+
// result which will not be caught by the conditional above that ends up
|
|
677
|
+
// throwing the markError result.
|
|
678
|
+
if (hasErrors) {
|
|
679
|
+
if (errorPolicy === "none") {
|
|
680
|
+
aqr.data = void 0;
|
|
681
|
+
aqr.dataState = "empty";
|
|
682
|
+
}
|
|
683
|
+
if (errorPolicy !== "ignore") {
|
|
684
|
+
aqr.error = new errors_1.CombinedGraphQLErrors(removeStreamDetailsFromExtensions(result));
|
|
685
|
+
if (aqr.dataState !== "streaming") {
|
|
686
|
+
aqr.networkStatus = networkStatus_js_1.NetworkStatus.error;
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
}
|
|
690
|
+
return aqr;
|
|
691
|
+
}), (0, rxjs_2.catchError)((error) => {
|
|
692
|
+
// Avoid storing errors from older interrupted queries.
|
|
693
|
+
if (requestId >= queryInfo.lastRequestId && errorPolicy === "none") {
|
|
694
|
+
queryInfo.resetLastWrite();
|
|
695
|
+
observableQuery?.["resetNotifications"]();
|
|
696
|
+
throw error;
|
|
697
|
+
}
|
|
698
|
+
const aqr = {
|
|
699
|
+
data: undefined,
|
|
700
|
+
dataState: "empty",
|
|
701
|
+
loading: false,
|
|
702
|
+
networkStatus: networkStatus_js_1.NetworkStatus.ready,
|
|
703
|
+
partial: true,
|
|
704
|
+
};
|
|
705
|
+
if (errorPolicy !== "ignore") {
|
|
706
|
+
aqr.error = error;
|
|
707
|
+
aqr.networkStatus = networkStatus_js_1.NetworkStatus.error;
|
|
708
|
+
}
|
|
709
|
+
return (0, rxjs_2.of)(aqr);
|
|
710
|
+
}));
|
|
711
|
+
}
|
|
712
|
+
fetchObservableWithInfo(options, {
|
|
713
|
+
// The initial networkStatus for this fetch, most often
|
|
714
|
+
// NetworkStatus.loading, but also possibly fetchMore, poll, refetch,
|
|
715
|
+
// or setVariables.
|
|
716
|
+
networkStatus = networkStatus_js_1.NetworkStatus.loading, query = options.query, fetchQueryOperator = (x) => x, onCacheHit = () => { }, observableQuery, exposeExtensions, }) {
|
|
717
|
+
const variables = this.getVariables(query, options.variables);
|
|
718
|
+
let { fetchPolicy = "cache-first", errorPolicy = "none", returnPartialData = false, notifyOnNetworkStatusChange = true, context = {}, } = options;
|
|
719
|
+
if (this.prioritizeCacheValues &&
|
|
720
|
+
(fetchPolicy === "network-only" || fetchPolicy === "cache-and-network")) {
|
|
721
|
+
fetchPolicy = "cache-first";
|
|
722
|
+
}
|
|
723
|
+
const normalized = Object.assign({}, options, {
|
|
724
|
+
query,
|
|
725
|
+
variables,
|
|
726
|
+
fetchPolicy,
|
|
727
|
+
errorPolicy,
|
|
728
|
+
returnPartialData,
|
|
729
|
+
notifyOnNetworkStatusChange,
|
|
730
|
+
context,
|
|
731
|
+
});
|
|
732
|
+
const queryInfo = new QueryInfo_js_1.QueryInfo(this, observableQuery);
|
|
733
|
+
const fromVariables = (variables) => {
|
|
734
|
+
// Since normalized is always a fresh copy of options, it's safe to
|
|
735
|
+
// modify its properties here, rather than creating yet another new
|
|
736
|
+
// WatchQueryOptions object.
|
|
737
|
+
normalized.variables = variables;
|
|
738
|
+
const cacheWriteBehavior = fetchPolicy === "no-cache" ? 0 /* CacheWriteBehavior.FORBID */
|
|
739
|
+
// Watched queries must opt into overwriting existing data on refetch,
|
|
740
|
+
// by passing refetchWritePolicy: "overwrite" in their WatchQueryOptions.
|
|
741
|
+
: (networkStatus === networkStatus_js_1.NetworkStatus.refetch &&
|
|
742
|
+
normalized.refetchWritePolicy !== "merge") ?
|
|
743
|
+
1 /* CacheWriteBehavior.OVERWRITE */
|
|
744
|
+
: 2 /* CacheWriteBehavior.MERGE */;
|
|
745
|
+
const observableWithInfo = this.fetchQueryByPolicy(normalized, {
|
|
746
|
+
queryInfo,
|
|
747
|
+
cacheWriteBehavior,
|
|
748
|
+
onCacheHit,
|
|
749
|
+
observableQuery,
|
|
750
|
+
exposeExtensions,
|
|
751
|
+
});
|
|
752
|
+
observableWithInfo.observable =
|
|
753
|
+
observableWithInfo.observable.pipe(fetchQueryOperator);
|
|
754
|
+
if (
|
|
755
|
+
// If we're in standby, postpone advancing options.fetchPolicy using
|
|
756
|
+
// applyNextFetchPolicy.
|
|
757
|
+
normalized.fetchPolicy !== "standby") {
|
|
758
|
+
observableQuery?.["applyNextFetchPolicy"]("after-fetch", options);
|
|
759
|
+
}
|
|
760
|
+
return observableWithInfo;
|
|
761
|
+
};
|
|
762
|
+
// This cancel function needs to be set before the concast is created,
|
|
763
|
+
// in case concast creation synchronously cancels the request.
|
|
764
|
+
const cleanupCancelFn = () => {
|
|
765
|
+
this.fetchCancelFns.delete(queryInfo.id);
|
|
766
|
+
};
|
|
767
|
+
this.fetchCancelFns.set(queryInfo.id, (error) => {
|
|
768
|
+
fetchCancelSubject.next({
|
|
769
|
+
kind: "E",
|
|
770
|
+
error,
|
|
771
|
+
source: "network",
|
|
772
|
+
});
|
|
773
|
+
});
|
|
774
|
+
const fetchCancelSubject = new rxjs_2.Subject();
|
|
775
|
+
let observable, containsDataFromLink;
|
|
776
|
+
// If the query has @export(as: ...) directives, then we need to
|
|
777
|
+
// process those directives asynchronously. When there are no
|
|
778
|
+
// @export directives (the common case), we deliberately avoid
|
|
779
|
+
// wrapping the result of this.fetchQueryByPolicy in a Promise,
|
|
780
|
+
// since the timing of result delivery is (unfortunately) important
|
|
781
|
+
// for backwards compatibility. TODO This code could be simpler if
|
|
782
|
+
// we deprecated and removed LocalState.
|
|
783
|
+
if (this.getDocumentInfo(normalized.query).hasClientExports) {
|
|
784
|
+
if (environment_1.__DEV__) {
|
|
785
|
+
(0, invariant_1.invariant)(
|
|
786
|
+
this.localState,
|
|
787
|
+
95,
|
|
788
|
+
(0, internal_1.getOperationName)(normalized.query, "(anonymous)")
|
|
789
|
+
);
|
|
790
|
+
}
|
|
791
|
+
observable = (0, rxjs_2.from)(this.localState.getExportedVariables({
|
|
792
|
+
client: this.client,
|
|
793
|
+
document: normalized.query,
|
|
794
|
+
variables: normalized.variables,
|
|
795
|
+
context: normalized.context,
|
|
796
|
+
})).pipe((0, rxjs_2.mergeMap)((variables) => fromVariables(variables).observable));
|
|
797
|
+
// there is just no way we can synchronously get the *right* value here,
|
|
798
|
+
// so we will assume `true`, which is the behaviour before the bug fix in
|
|
799
|
+
// #10597. This means that bug is not fixed in that case, and is probably
|
|
800
|
+
// un-fixable with reasonable effort for the edge case of @export as
|
|
801
|
+
// directives.
|
|
802
|
+
containsDataFromLink = true;
|
|
803
|
+
}
|
|
804
|
+
else {
|
|
805
|
+
const sourcesWithInfo = fromVariables(normalized.variables);
|
|
806
|
+
containsDataFromLink = sourcesWithInfo.fromLink;
|
|
807
|
+
observable = sourcesWithInfo.observable;
|
|
808
|
+
}
|
|
809
|
+
return {
|
|
810
|
+
// Merge `observable` with `fetchCancelSubject`, in a way that completing or
|
|
811
|
+
// erroring either of them will complete the merged obserable.
|
|
812
|
+
observable: new rxjs_1.Observable((observer) => {
|
|
813
|
+
observer.add(cleanupCancelFn);
|
|
814
|
+
observable.subscribe(observer);
|
|
815
|
+
fetchCancelSubject.subscribe(observer);
|
|
816
|
+
}).pipe((0, rxjs_2.share)()),
|
|
817
|
+
fromLink: containsDataFromLink,
|
|
818
|
+
};
|
|
819
|
+
}
|
|
820
|
+
refetchQueries({ updateCache, include, optimistic = false, removeOptimistic = optimistic ? (0, internal_1.makeUniqueId)("refetchQueries") : void 0, onQueryUpdated, }) {
|
|
821
|
+
const includedQueriesByOq = new Map();
|
|
822
|
+
if (include) {
|
|
823
|
+
this.getObservableQueries(include).forEach((oq) => {
|
|
824
|
+
if (oq.options.fetchPolicy === "cache-only" || oq["variablesUnknown"]) {
|
|
825
|
+
return;
|
|
826
|
+
}
|
|
827
|
+
const current = oq.getCurrentResult();
|
|
828
|
+
includedQueriesByOq.set(oq, {
|
|
829
|
+
oq,
|
|
830
|
+
lastDiff: {
|
|
831
|
+
result: current?.data,
|
|
832
|
+
complete: !current?.partial,
|
|
833
|
+
},
|
|
834
|
+
});
|
|
835
|
+
});
|
|
836
|
+
}
|
|
837
|
+
const results = new Map();
|
|
838
|
+
if (updateCache) {
|
|
839
|
+
const handled = new Set();
|
|
840
|
+
this.cache.batch({
|
|
841
|
+
update: updateCache,
|
|
842
|
+
// Since you can perform any combination of cache reads and/or writes in
|
|
843
|
+
// the cache.batch update function, its optimistic option can be either
|
|
844
|
+
// a boolean or a string, representing three distinct modes of
|
|
845
|
+
// operation:
|
|
846
|
+
//
|
|
847
|
+
// * false: read/write only the root layer
|
|
848
|
+
// * true: read/write the topmost layer
|
|
849
|
+
// * string: read/write a fresh optimistic layer with that ID string
|
|
850
|
+
//
|
|
851
|
+
// When typeof optimistic === "string", a new optimistic layer will be
|
|
852
|
+
// temporarily created within cache.batch with that string as its ID. If
|
|
853
|
+
// we then pass that same string as the removeOptimistic option, we can
|
|
854
|
+
// make cache.batch immediately remove the optimistic layer after
|
|
855
|
+
// running the updateCache function, triggering only one broadcast.
|
|
856
|
+
//
|
|
857
|
+
// However, the refetchQueries method accepts only true or false for its
|
|
858
|
+
// optimistic option (not string). We interpret true to mean a temporary
|
|
859
|
+
// optimistic layer should be created, to allow efficiently rolling back
|
|
860
|
+
// the effect of the updateCache function, which involves passing a
|
|
861
|
+
// string instead of true as the optimistic option to cache.batch, when
|
|
862
|
+
// refetchQueries receives optimistic: true.
|
|
863
|
+
//
|
|
864
|
+
// In other words, we are deliberately not supporting the use case of
|
|
865
|
+
// writing to an *existing* optimistic layer (using the refetchQueries
|
|
866
|
+
// updateCache function), since that would potentially interfere with
|
|
867
|
+
// other optimistic updates in progress. Instead, you can read/write
|
|
868
|
+
// only the root layer by passing optimistic: false to refetchQueries,
|
|
869
|
+
// or you can read/write a brand new optimistic layer that will be
|
|
870
|
+
// automatically removed by passing optimistic: true.
|
|
871
|
+
optimistic: (optimistic && removeOptimistic) || false,
|
|
872
|
+
// The removeOptimistic option can also be provided by itself, even if
|
|
873
|
+
// optimistic === false, to remove some previously-added optimistic
|
|
874
|
+
// layer safely and efficiently, like we do in markMutationResult.
|
|
875
|
+
//
|
|
876
|
+
// If an explicit removeOptimistic string is provided with optimistic:
|
|
877
|
+
// true, the removeOptimistic string will determine the ID of the
|
|
878
|
+
// temporary optimistic layer, in case that ever matters.
|
|
879
|
+
removeOptimistic,
|
|
880
|
+
onWatchUpdated(watch, diff, lastDiff) {
|
|
881
|
+
const oq = watch.watcher;
|
|
882
|
+
if (oq instanceof ObservableQuery_js_1.ObservableQuery && !handled.has(oq)) {
|
|
883
|
+
handled.add(oq);
|
|
884
|
+
if (onQueryUpdated) {
|
|
885
|
+
// Since we're about to handle this query now, remove it from
|
|
886
|
+
// includedQueriesById, in case it was added earlier because of
|
|
887
|
+
// options.include.
|
|
888
|
+
includedQueriesByOq.delete(oq);
|
|
889
|
+
let result = onQueryUpdated(oq, diff, lastDiff);
|
|
890
|
+
if (result === true) {
|
|
891
|
+
// The onQueryUpdated function requested the default refetching
|
|
892
|
+
// behavior by returning true.
|
|
893
|
+
result = oq
|
|
894
|
+
.refetch()
|
|
895
|
+
.retain( /* create a persistent subscription on the query */);
|
|
896
|
+
}
|
|
897
|
+
// Record the result in the results Map, as long as onQueryUpdated
|
|
898
|
+
// did not return false to skip/ignore this result.
|
|
899
|
+
if (result !== false) {
|
|
900
|
+
results.set(oq, result);
|
|
901
|
+
}
|
|
902
|
+
// Allow the default cache broadcast to happen, except when
|
|
903
|
+
// onQueryUpdated returns false.
|
|
904
|
+
return result;
|
|
905
|
+
}
|
|
906
|
+
if (onQueryUpdated !== null &&
|
|
907
|
+
oq.options.fetchPolicy !== "cache-only") {
|
|
908
|
+
// If we don't have an onQueryUpdated function, and onQueryUpdated
|
|
909
|
+
// was not disabled by passing null, make sure this query is
|
|
910
|
+
// "included" like any other options.include-specified query.
|
|
911
|
+
includedQueriesByOq.set(oq, { oq, lastDiff, diff });
|
|
912
|
+
}
|
|
913
|
+
}
|
|
914
|
+
},
|
|
915
|
+
});
|
|
916
|
+
}
|
|
917
|
+
if (includedQueriesByOq.size) {
|
|
918
|
+
includedQueriesByOq.forEach(({ oq, lastDiff, diff }) => {
|
|
919
|
+
let result;
|
|
920
|
+
// If onQueryUpdated is provided, we want to use it for all included
|
|
921
|
+
// queries, even the QueryOptions ones.
|
|
922
|
+
if (onQueryUpdated) {
|
|
923
|
+
if (!diff) {
|
|
924
|
+
diff = oq.getCacheDiff();
|
|
925
|
+
}
|
|
926
|
+
result = onQueryUpdated(oq, diff, lastDiff);
|
|
927
|
+
}
|
|
928
|
+
// Otherwise, we fall back to refetching.
|
|
929
|
+
if (!onQueryUpdated || result === true) {
|
|
930
|
+
result = oq
|
|
931
|
+
.refetch()
|
|
932
|
+
.retain( /* create a persistent subscription on the query */);
|
|
933
|
+
}
|
|
934
|
+
if (result !== false) {
|
|
935
|
+
results.set(oq, result);
|
|
936
|
+
}
|
|
937
|
+
});
|
|
938
|
+
}
|
|
939
|
+
if (removeOptimistic) {
|
|
940
|
+
// In case no updateCache callback was provided (so cache.batch was not
|
|
941
|
+
// called above, and thus did not already remove the optimistic layer),
|
|
942
|
+
// remove it here. Since this is a no-op when the layer has already been
|
|
943
|
+
// removed, we do it even if we called cache.batch above, since it's
|
|
944
|
+
// possible this.cache is an instance of some ApolloCache subclass other
|
|
945
|
+
// than InMemoryCache, and does not fully support the removeOptimistic
|
|
946
|
+
// option for cache.batch.
|
|
947
|
+
this.cache.removeOptimistic(removeOptimistic);
|
|
948
|
+
}
|
|
949
|
+
return results;
|
|
950
|
+
}
|
|
951
|
+
noCacheWarningsByCause = new WeakSet();
|
|
952
|
+
maskOperation(options) {
|
|
953
|
+
const { document, data } = options;
|
|
954
|
+
if (environment_1.__DEV__) {
|
|
955
|
+
const { fetchPolicy, cause = {} } = options;
|
|
956
|
+
const operationType = (0, internal_1.getOperationDefinition)(document)?.operation;
|
|
957
|
+
if (this.dataMasking &&
|
|
958
|
+
fetchPolicy === "no-cache" &&
|
|
959
|
+
!isFullyUnmaskedOperation(document) &&
|
|
960
|
+
!this.noCacheWarningsByCause.has(cause)) {
|
|
961
|
+
this.noCacheWarningsByCause.add(cause);
|
|
962
|
+
__DEV__ && invariant_1.invariant.warn(
|
|
963
|
+
96,
|
|
964
|
+
(0, internal_1.getOperationName)(document, `Unnamed ${operationType ?? "operation"}`)
|
|
965
|
+
);
|
|
966
|
+
}
|
|
967
|
+
}
|
|
968
|
+
return (this.dataMasking ?
|
|
969
|
+
(0, masking_1.maskOperation)(data, document, this.cache)
|
|
970
|
+
: data);
|
|
971
|
+
}
|
|
972
|
+
maskFragment(options) {
|
|
973
|
+
const { data, fragment, fragmentName } = options;
|
|
974
|
+
return this.dataMasking ?
|
|
975
|
+
(0, masking_1.maskFragment)(data, fragment, this.cache, fragmentName)
|
|
976
|
+
: data;
|
|
977
|
+
}
|
|
978
|
+
fetchQueryByPolicy({ query, variables, fetchPolicy, errorPolicy, returnPartialData, context, }, { cacheWriteBehavior, onCacheHit, queryInfo, observableQuery, exposeExtensions, }) {
|
|
979
|
+
const readCache = () => this.cache.diff({
|
|
980
|
+
query,
|
|
981
|
+
variables,
|
|
982
|
+
returnPartialData: true,
|
|
983
|
+
optimistic: true,
|
|
984
|
+
});
|
|
985
|
+
const resultsFromCache = (diff, networkStatus) => {
|
|
986
|
+
const data = diff.result;
|
|
987
|
+
if (environment_1.__DEV__ && !returnPartialData && data !== null) {
|
|
988
|
+
(0, ObservableQuery_js_1.logMissingFieldErrors)(diff.missing);
|
|
989
|
+
}
|
|
990
|
+
const toResult = (data) => {
|
|
991
|
+
// TODO: Eventually we should move this handling into
|
|
992
|
+
// queryInfo.getDiff() directly. Since getDiff is updated to return null
|
|
993
|
+
// on returnPartialData: false, we should take advantage of that instead
|
|
994
|
+
// of having to patch it elsewhere.
|
|
995
|
+
if (!diff.complete && !returnPartialData) {
|
|
996
|
+
data = undefined;
|
|
997
|
+
}
|
|
998
|
+
return {
|
|
999
|
+
// TODO: Handle partial data
|
|
1000
|
+
data: data,
|
|
1001
|
+
dataState: diff.complete ? "complete"
|
|
1002
|
+
: data ? "partial"
|
|
1003
|
+
: "empty",
|
|
1004
|
+
loading: (0, utilities_1.isNetworkRequestInFlight)(networkStatus),
|
|
1005
|
+
networkStatus,
|
|
1006
|
+
partial: !diff.complete,
|
|
1007
|
+
};
|
|
1008
|
+
};
|
|
1009
|
+
const fromData = (data) => {
|
|
1010
|
+
return (0, rxjs_2.of)({
|
|
1011
|
+
kind: "N",
|
|
1012
|
+
value: toResult(data),
|
|
1013
|
+
source: "cache",
|
|
1014
|
+
});
|
|
1015
|
+
};
|
|
1016
|
+
if (
|
|
1017
|
+
// Don't attempt to run forced resolvers if we have incomplete cache
|
|
1018
|
+
// data and partial isn't allowed since this result would get set to
|
|
1019
|
+
// `undefined` anyways in `toResult`.
|
|
1020
|
+
(diff.complete || returnPartialData) &&
|
|
1021
|
+
this.getDocumentInfo(query).hasForcedResolvers) {
|
|
1022
|
+
if (environment_1.__DEV__) {
|
|
1023
|
+
(0, invariant_1.invariant)(
|
|
1024
|
+
this.localState,
|
|
1025
|
+
97,
|
|
1026
|
+
(0, internal_1.getOperationName)(query, "(anonymous)")
|
|
1027
|
+
);
|
|
1028
|
+
}
|
|
1029
|
+
onCacheHit();
|
|
1030
|
+
return (0, rxjs_2.from)(this.localState.execute({
|
|
1031
|
+
client: this.client,
|
|
1032
|
+
document: query,
|
|
1033
|
+
remoteResult: data ? { data } : undefined,
|
|
1034
|
+
context,
|
|
1035
|
+
variables,
|
|
1036
|
+
onlyRunForcedResolvers: true,
|
|
1037
|
+
returnPartialData: true,
|
|
1038
|
+
fetchPolicy,
|
|
1039
|
+
}).then((resolved) => ({
|
|
1040
|
+
kind: "N",
|
|
1041
|
+
value: toResult(resolved.data || void 0),
|
|
1042
|
+
source: "cache",
|
|
1043
|
+
})));
|
|
1044
|
+
}
|
|
1045
|
+
// Resolves https://github.com/apollographql/apollo-client/issues/10317.
|
|
1046
|
+
// If errorPolicy is 'none' and notifyOnNetworkStatusChange is true,
|
|
1047
|
+
// data was incorrectly returned from the cache on refetch:
|
|
1048
|
+
// if diff.missing exists, we should not return cache data.
|
|
1049
|
+
if (errorPolicy === "none" &&
|
|
1050
|
+
networkStatus === networkStatus_js_1.NetworkStatus.refetch &&
|
|
1051
|
+
diff.missing) {
|
|
1052
|
+
return fromData(void 0);
|
|
1053
|
+
}
|
|
1054
|
+
return fromData(data || undefined);
|
|
1055
|
+
};
|
|
1056
|
+
const resultsFromLink = () => this.getResultsFromLink({
|
|
1057
|
+
query,
|
|
1058
|
+
variables,
|
|
1059
|
+
context,
|
|
1060
|
+
fetchPolicy,
|
|
1061
|
+
errorPolicy,
|
|
1062
|
+
}, {
|
|
1063
|
+
cacheWriteBehavior,
|
|
1064
|
+
queryInfo,
|
|
1065
|
+
observableQuery,
|
|
1066
|
+
exposeExtensions,
|
|
1067
|
+
}).pipe(validateDidEmitValue(), (0, rxjs_2.materialize)(), (0, rxjs_2.map)((result) => ({
|
|
1068
|
+
...result,
|
|
1069
|
+
source: "network",
|
|
1070
|
+
})));
|
|
1071
|
+
switch (fetchPolicy) {
|
|
1072
|
+
default:
|
|
1073
|
+
case "cache-first": {
|
|
1074
|
+
const diff = readCache();
|
|
1075
|
+
if (diff.complete) {
|
|
1076
|
+
return {
|
|
1077
|
+
fromLink: false,
|
|
1078
|
+
observable: resultsFromCache(diff, networkStatus_js_1.NetworkStatus.ready),
|
|
1079
|
+
};
|
|
1080
|
+
}
|
|
1081
|
+
if (returnPartialData) {
|
|
1082
|
+
return {
|
|
1083
|
+
fromLink: true,
|
|
1084
|
+
observable: (0, rxjs_2.concat)(resultsFromCache(diff, networkStatus_js_1.NetworkStatus.loading), resultsFromLink()),
|
|
1085
|
+
};
|
|
1086
|
+
}
|
|
1087
|
+
return { fromLink: true, observable: resultsFromLink() };
|
|
1088
|
+
}
|
|
1089
|
+
case "cache-and-network": {
|
|
1090
|
+
const diff = readCache();
|
|
1091
|
+
if (diff.complete || returnPartialData) {
|
|
1092
|
+
return {
|
|
1093
|
+
fromLink: true,
|
|
1094
|
+
observable: (0, rxjs_2.concat)(resultsFromCache(diff, networkStatus_js_1.NetworkStatus.loading), resultsFromLink()),
|
|
1095
|
+
};
|
|
1096
|
+
}
|
|
1097
|
+
return { fromLink: true, observable: resultsFromLink() };
|
|
1098
|
+
}
|
|
1099
|
+
case "cache-only":
|
|
1100
|
+
return {
|
|
1101
|
+
fromLink: false,
|
|
1102
|
+
observable: (0, rxjs_2.concat)(resultsFromCache(readCache(), networkStatus_js_1.NetworkStatus.ready)),
|
|
1103
|
+
};
|
|
1104
|
+
case "network-only":
|
|
1105
|
+
return { fromLink: true, observable: resultsFromLink() };
|
|
1106
|
+
case "no-cache":
|
|
1107
|
+
return { fromLink: true, observable: resultsFromLink() };
|
|
1108
|
+
case "standby":
|
|
1109
|
+
return { fromLink: false, observable: rxjs_2.EMPTY };
|
|
1110
|
+
}
|
|
1111
|
+
}
|
|
1112
|
+
}
|
|
1113
|
+
exports.QueryManager = QueryManager;
|
|
1114
|
+
function validateDidEmitValue() {
|
|
1115
|
+
let didEmitValue = false;
|
|
1116
|
+
return (0, rxjs_2.tap)({
|
|
1117
|
+
next() {
|
|
1118
|
+
didEmitValue = true;
|
|
1119
|
+
},
|
|
1120
|
+
complete() {
|
|
1121
|
+
(0, invariant_1.invariant)(didEmitValue, 98);
|
|
1122
|
+
},
|
|
1123
|
+
});
|
|
1124
|
+
}
|
|
1125
|
+
function isFullyUnmaskedOperation(document) {
|
|
1126
|
+
let isUnmasked = true;
|
|
1127
|
+
(0, graphql_1.visit)(document, {
|
|
1128
|
+
FragmentSpread: (node) => {
|
|
1129
|
+
isUnmasked =
|
|
1130
|
+
!!node.directives &&
|
|
1131
|
+
node.directives.some((directive) => directive.name.value === "unmask");
|
|
1132
|
+
if (!isUnmasked) {
|
|
1133
|
+
return graphql_1.BREAK;
|
|
1134
|
+
}
|
|
1135
|
+
},
|
|
1136
|
+
});
|
|
1137
|
+
return isUnmasked;
|
|
1138
|
+
}
|
|
1139
|
+
function addNonReactiveToNamedFragments(document) {
|
|
1140
|
+
return (0, graphql_1.visit)(document, {
|
|
1141
|
+
FragmentSpread: (node) => {
|
|
1142
|
+
// Do not add `@nonreactive` if the fragment is marked with `@unmask`
|
|
1143
|
+
// since we want to react to changes in this fragment.
|
|
1144
|
+
if (node.directives?.some((directive) => directive.name.value === "unmask")) {
|
|
1145
|
+
return;
|
|
1146
|
+
}
|
|
1147
|
+
return {
|
|
1148
|
+
...node,
|
|
1149
|
+
directives: [
|
|
1150
|
+
...(node.directives || []),
|
|
1151
|
+
{
|
|
1152
|
+
kind: graphql_1.Kind.DIRECTIVE,
|
|
1153
|
+
name: { kind: graphql_1.Kind.NAME, value: "nonreactive" },
|
|
1154
|
+
},
|
|
1155
|
+
],
|
|
1156
|
+
};
|
|
1157
|
+
},
|
|
1158
|
+
});
|
|
1159
|
+
}
|
|
1160
|
+
function removeStreamDetailsFromExtensions(original) {
|
|
1161
|
+
if (original.extensions?.[internal_1.streamInfoSymbol] == null) {
|
|
1162
|
+
return original;
|
|
1163
|
+
}
|
|
1164
|
+
const { extensions: { [internal_1.streamInfoSymbol]: _, ...extensions }, ...result } = original;
|
|
1165
|
+
if (Object.keys(extensions).length > 0) {
|
|
1166
|
+
result.extensions = extensions;
|
|
1167
|
+
}
|
|
1168
|
+
return result;
|
|
1169
|
+
}
|
|
1170
|
+
//# sourceMappingURL=QueryManager.cjs.map
|