@apollo/client 4.0.0-rc.5 → 4.0.0-rc.6
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 +18 -0
- package/README.md +40 -40
- package/__cjs/cache/core/cache.cjs +2 -6
- package/__cjs/cache/core/cache.cjs.map +1 -1
- package/__cjs/cache/core/cache.d.cts +65 -64
- package/__cjs/cache/core/types/Cache.cjs +0 -4
- package/__cjs/cache/core/types/Cache.cjs.map +1 -1
- package/__cjs/cache/core/types/Cache.d.cts +200 -15
- package/__cjs/cache/{core/types/DataProxy.cjs → deprecated.cjs} +1 -1
- package/__cjs/cache/deprecated.cjs.map +1 -0
- package/__cjs/cache/deprecated.d.cts +6 -0
- package/__cjs/cache/index.cjs.map +1 -1
- package/__cjs/cache/index.d.cts +2 -2
- package/__cjs/cache/inmemory/entityStore.cjs +25 -28
- package/__cjs/cache/inmemory/entityStore.cjs.map +1 -1
- package/__cjs/cache/inmemory/entityStore.d.cts +17 -16
- package/__cjs/cache/inmemory/inMemoryCache.cjs.map +1 -1
- package/__cjs/cache/inmemory/inMemoryCache.d.cts +4 -4
- package/__cjs/cache/inmemory/key-extractor.cjs +1 -1
- package/__cjs/cache/inmemory/policies.cjs +4 -4
- package/__cjs/cache/inmemory/policies.cjs.map +1 -1
- package/__cjs/cache/inmemory/policies.d.cts +3 -2
- package/__cjs/cache/inmemory/readFromStore.cjs +2 -2
- package/__cjs/cache/inmemory/writeToStore.cjs +4 -4
- package/__cjs/cache/inmemory/writeToStore.cjs.map +1 -1
- package/__cjs/cache/inmemory/writeToStore.d.cts +1 -1
- package/__cjs/core/ApolloClient.cjs +92 -110
- package/__cjs/core/ApolloClient.cjs.map +1 -1
- package/__cjs/core/ApolloClient.d.cts +774 -180
- package/__cjs/core/ObservableQuery.cjs +10 -10
- package/__cjs/core/ObservableQuery.cjs.map +1 -1
- package/__cjs/core/ObservableQuery.d.cts +120 -68
- package/__cjs/core/QueryInfo.cjs.map +1 -1
- package/__cjs/core/QueryInfo.d.cts +5 -4
- package/__cjs/core/QueryManager.cjs +15 -13
- package/__cjs/core/QueryManager.cjs.map +1 -1
- package/__cjs/core/QueryManager.d.cts +17 -17
- 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.map +1 -1
- package/__cjs/core/index.d.cts +9 -5
- package/__cjs/core/types.d.cts +29 -129
- package/__cjs/core/watchQueryOptions.d.cts +8 -297
- package/__cjs/dev/setErrorMessageHandler.cjs.map +1 -1
- package/__cjs/dev/setErrorMessageHandler.d.cts +4 -4
- package/__cjs/errors/CombinedGraphQLErrors.cjs +59 -11
- package/__cjs/errors/CombinedGraphQLErrors.cjs.map +1 -1
- package/__cjs/errors/CombinedGraphQLErrors.d.cts +146 -11
- package/__cjs/errors/CombinedProtocolErrors.cjs +48 -1
- package/__cjs/errors/CombinedProtocolErrors.cjs.map +1 -1
- package/__cjs/errors/CombinedProtocolErrors.d.cts +126 -2
- package/__cjs/errors/LinkError.cjs +45 -2
- package/__cjs/errors/LinkError.cjs.map +1 -1
- package/__cjs/errors/LinkError.d.cts +45 -2
- package/__cjs/errors/LocalStateError.cjs +35 -5
- package/__cjs/errors/LocalStateError.cjs.map +1 -1
- package/__cjs/errors/LocalStateError.d.cts +41 -5
- package/__cjs/errors/ServerError.cjs +50 -8
- package/__cjs/errors/ServerError.cjs.map +1 -1
- package/__cjs/errors/ServerError.d.cts +70 -11
- package/__cjs/errors/ServerParseError.cjs +45 -8
- package/__cjs/errors/ServerParseError.cjs.map +1 -1
- package/__cjs/errors/ServerParseError.d.cts +71 -16
- package/__cjs/errors/UnconventionalError.cjs +46 -2
- package/__cjs/errors/UnconventionalError.cjs.map +1 -1
- package/__cjs/errors/UnconventionalError.d.cts +46 -2
- package/__cjs/incremental/handlers/notImplemented.cjs +1 -1
- package/__cjs/invariantErrorCodes.cjs +72 -80
- package/__cjs/link/batch/batchLink.cjs.map +1 -1
- package/__cjs/link/batch-http/batchHttpLink.cjs +2 -2
- package/__cjs/link/batch-http/batchHttpLink.cjs.map +1 -1
- package/__cjs/link/client-awareness/ClientAwarenessLink.cjs.map +1 -1
- package/__cjs/link/client-awareness/ClientAwarenessLink.d.cts +4 -4
- package/__cjs/link/context/index.cjs +1 -1
- package/__cjs/link/context/index.cjs.map +1 -1
- package/__cjs/link/context/index.d.cts +1 -1
- package/__cjs/link/core/ApolloLink.cjs +2 -2
- package/__cjs/link/core/types.d.cts +2 -2
- package/__cjs/link/error/index.cjs.map +1 -1
- package/__cjs/link/error/index.d.cts +16 -1
- package/__cjs/link/http/HttpLink.cjs.map +1 -1
- package/__cjs/link/http/HttpLink.d.cts +2 -1
- package/__cjs/link/http/checkFetcher.cjs +1 -1
- package/__cjs/link/http/parseAndCheckHttpResponse.cjs +1 -1
- package/__cjs/link/http/serializeFetchParameter.cjs +1 -1
- package/__cjs/link/persisted-queries/index.cjs +2 -2
- package/__cjs/link/persisted-queries/index.cjs.map +1 -1
- package/__cjs/link/persisted-queries/index.d.cts +11 -11
- package/__cjs/link/retry/delayFunction.cjs.map +1 -1
- package/__cjs/link/retry/delayFunction.d.cts +1 -1
- package/__cjs/link/retry/retryFunction.cjs.map +1 -1
- package/__cjs/link/retry/retryFunction.d.cts +1 -1
- package/__cjs/link/retry/retryLink.cjs.map +1 -1
- package/__cjs/link/schema/index.cjs.map +1 -1
- package/__cjs/link/utils/validateOperation.cjs +1 -1
- package/__cjs/link/ws/index.cjs.map +1 -1
- package/__cjs/local-state/LocalState.cjs +55 -9
- package/__cjs/local-state/LocalState.cjs.map +1 -1
- package/__cjs/local-state/LocalState.d.cts +94 -0
- package/__cjs/masking/GraphQLCodegenDataMasking.d.cts +6 -7
- package/__cjs/masking/internal/types.d.cts +70 -70
- package/__cjs/masking/maskDefinition.cjs +2 -2
- package/__cjs/masking/maskFragment.cjs +2 -2
- package/__cjs/masking/maskOperation.cjs +1 -1
- package/__cjs/masking/utils.cjs +3 -3
- package/__cjs/react/context/ApolloContext.cjs +1 -1
- package/__cjs/react/context/ApolloProvider.cjs +1 -1
- package/__cjs/react/hooks/internal/useDeepMemo.cjs +0 -3
- package/__cjs/react/hooks/internal/useDeepMemo.cjs.map +1 -1
- package/__cjs/react/hooks/internal/validateSuspenseHookOptions.cjs.map +1 -1
- package/__cjs/react/hooks/internal/validateSuspenseHookOptions.d.cts +2 -2
- package/__cjs/react/hooks/internal/wrapHook.cjs +1 -0
- package/__cjs/react/hooks/internal/wrapHook.cjs.map +1 -1
- package/__cjs/react/hooks/internal/wrapHook.d.cts +8 -7
- package/__cjs/react/hooks/useApolloClient.cjs +2 -2
- package/__cjs/react/hooks/useApolloClient.cjs.map +1 -1
- package/__cjs/react/hooks/useApolloClient.d.cts +2 -2
- package/__cjs/react/hooks/useBackgroundQuery.cjs.map +1 -1
- package/__cjs/react/hooks/useBackgroundQuery.d.cts +814 -86
- package/__cjs/react/hooks/useFragment.cjs +7 -0
- package/__cjs/react/hooks/useFragment.cjs.map +1 -1
- package/__cjs/react/hooks/useFragment.d.cts +53 -2
- package/__cjs/react/hooks/useLazyQuery.cjs +0 -38
- package/__cjs/react/hooks/useLazyQuery.cjs.map +1 -1
- package/__cjs/react/hooks/useLazyQuery.d.cts +309 -119
- package/__cjs/react/hooks/useLoadableQuery.cjs.map +1 -1
- package/__cjs/react/hooks/useLoadableQuery.d.cts +113 -126
- package/__cjs/react/hooks/useMutation.cjs +6 -7
- package/__cjs/react/hooks/useMutation.cjs.map +1 -1
- package/__cjs/react/hooks/useMutation.d.cts +57 -17
- package/__cjs/react/hooks/useQuery.cjs +1 -35
- package/__cjs/react/hooks/useQuery.cjs.map +1 -1
- package/__cjs/react/hooks/useQuery.d.cts +163 -18
- package/__cjs/react/hooks/useQueryRefHandlers.cjs +2 -1
- package/__cjs/react/hooks/useQueryRefHandlers.cjs.map +1 -1
- package/__cjs/react/hooks/useQueryRefHandlers.d.cts +21 -1
- package/__cjs/react/hooks/useReactiveVar.cjs +2 -1
- package/__cjs/react/hooks/useReactiveVar.cjs.map +1 -1
- package/__cjs/react/hooks/useReactiveVar.d.cts +2 -1
- package/__cjs/react/hooks/useReadQuery.cjs +29 -0
- package/__cjs/react/hooks/useReadQuery.cjs.map +1 -1
- package/__cjs/react/hooks/useReadQuery.d.cts +95 -16
- package/__cjs/react/hooks/useSubscription.cjs +8 -9
- package/__cjs/react/hooks/useSubscription.cjs.map +1 -1
- package/__cjs/react/hooks/useSubscription.d.cts +99 -32
- package/__cjs/react/hooks/useSuspenseFragment.cjs.map +1 -1
- package/__cjs/react/hooks/useSuspenseFragment.d.cts +61 -29
- package/__cjs/react/hooks/useSuspenseQuery.cjs +4 -1
- package/__cjs/react/hooks/useSuspenseQuery.cjs.map +1 -1
- package/__cjs/react/hooks/useSuspenseQuery.d.cts +438 -17
- package/__cjs/react/index.cjs +1 -3
- package/__cjs/react/index.cjs.map +1 -1
- package/__cjs/react/index.d.cts +0 -1
- package/__cjs/react/index.react-server.cjs +1 -3
- package/__cjs/react/index.react-server.cjs.map +1 -1
- package/__cjs/react/index.react-server.d.cts +0 -1
- package/__cjs/react/internal/cache/FragmentReference.cjs.map +1 -1
- package/__cjs/react/internal/cache/FragmentReference.d.cts +2 -3
- package/__cjs/react/internal/cache/QueryReference.cjs.map +1 -1
- package/__cjs/react/internal/cache/QueryReference.d.cts +11 -11
- package/__cjs/react/internal/cache/SuspenseCache.cjs.map +1 -1
- package/__cjs/react/internal/cache/SuspenseCache.d.cts +2 -2
- package/__cjs/react/internal/cache/getSuspenseCache.cjs.map +1 -1
- package/__cjs/react/internal/cache/getSuspenseCache.d.cts +6 -4
- package/__cjs/react/internal/index.cjs +1 -0
- package/__cjs/react/internal/index.cjs.map +1 -1
- package/__cjs/react/internal/index.d.cts +1 -1
- package/__cjs/react/internal/types.d.cts +3 -3
- package/__cjs/react/query-preloader/createQueryPreloader.cjs +1 -1
- package/__cjs/react/query-preloader/createQueryPreloader.cjs.map +1 -1
- package/__cjs/react/query-preloader/createQueryPreloader.d.cts +31 -31
- package/__cjs/react/ssr/prerenderStatic.cjs +5 -4
- package/__cjs/react/ssr/prerenderStatic.cjs.map +1 -1
- package/__cjs/react/ssr/prerenderStatic.d.cts +11 -9
- package/__cjs/react/ssr/useSSRQuery.cjs.map +1 -1
- package/__cjs/react/types/deprecated.d.cts +1 -1
- package/__cjs/react/types/types.documentation.d.cts +10 -10
- package/__cjs/testing/core/mocking/mockLink.cjs.map +1 -1
- package/__cjs/testing/core/mocking/mockLink.d.cts +3 -2
- package/__cjs/testing/core/types/deprecated.d.cts +3 -2
- package/__cjs/testing/react/MockedProvider.cjs.map +1 -1
- package/__cjs/testing/react/MockedProvider.d.cts +2 -3
- package/__cjs/utilities/HKT.d.cts +8 -7
- package/__cjs/utilities/caching/sizes.cjs +3 -3
- package/__cjs/utilities/caching/sizes.cjs.map +1 -1
- package/__cjs/utilities/caching/sizes.d.cts +4 -6
- package/__cjs/utilities/graphql/DocumentTransform.cjs +2 -2
- package/__cjs/utilities/graphql/DocumentTransform.cjs.map +1 -1
- package/__cjs/utilities/index.cjs +2 -3
- package/__cjs/utilities/index.cjs.map +1 -1
- package/__cjs/utilities/index.d.cts +1 -2
- package/__cjs/utilities/{shared → internal}/canonicalStringify.cjs +5 -7
- package/__cjs/utilities/internal/canonicalStringify.cjs.map +1 -0
- package/__cjs/utilities/{shared → internal}/canonicalStringify.d.cts +1 -1
- package/__cjs/utilities/internal/checkDocument.cjs +2 -2
- package/__cjs/utilities/internal/checkDocument.cjs.map +1 -1
- package/__cjs/utilities/internal/createFragmentMap.cjs.map +1 -1
- package/__cjs/{core → utilities/internal}/equalByQuery.cjs +13 -7
- package/__cjs/utilities/internal/equalByQuery.cjs.map +1 -0
- package/__cjs/utilities/internal/equalByQuery.d.cts +5 -0
- package/__cjs/utilities/internal/getFragmentQueryDocument.cjs +13 -3
- package/__cjs/utilities/internal/getFragmentQueryDocument.cjs.map +1 -1
- package/__cjs/utilities/internal/getFragmentQueryDocument.d.cts +13 -3
- package/__cjs/utilities/internal/getMemoryInternals.cjs.map +1 -1
- package/__cjs/utilities/internal/getStoreKeyName.cjs +1 -2
- package/__cjs/utilities/internal/getStoreKeyName.cjs.map +1 -1
- package/__cjs/utilities/internal/index.cjs +6 -2
- package/__cjs/utilities/internal/index.cjs.map +1 -1
- package/__cjs/utilities/internal/index.d.cts +2 -0
- package/__cjs/utilities/internal/mergeOptions.cjs.map +1 -1
- package/__cjs/utilities/internal/mergeOptions.d.cts +2 -2
- package/__cjs/utilities/internal/toQueryResult.cjs.map +1 -1
- package/__cjs/utilities/internal/toQueryResult.d.cts +2 -2
- package/__cjs/utilities/internal/types/DocumentationTypes.d.cts +16 -2
- package/__cjs/utilities/internal/types/NoInfer.d.cts +31 -25
- package/__cjs/utilities/subscriptions/relay/index.cjs +2 -0
- package/__cjs/utilities/subscriptions/relay/index.cjs.map +1 -1
- package/__cjs/version.cjs +1 -1
- package/cache/core/cache.d.ts +65 -64
- package/cache/core/cache.js +3 -7
- package/cache/core/cache.js.map +1 -1
- package/cache/core/types/Cache.d.ts +200 -15
- package/cache/core/types/Cache.js +1 -3
- package/cache/core/types/Cache.js.map +1 -1
- 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 +2 -2
- package/cache/index.js.map +1 -1
- package/cache/inmemory/entityStore.d.ts +17 -16
- package/cache/inmemory/entityStore.js +25 -28
- package/cache/inmemory/entityStore.js.map +1 -1
- package/cache/inmemory/inMemoryCache.d.ts +4 -4
- package/cache/inmemory/inMemoryCache.js.map +1 -1
- package/cache/inmemory/key-extractor.js +1 -1
- package/cache/inmemory/policies.d.ts +3 -2
- package/cache/inmemory/policies.js +4 -4
- package/cache/inmemory/policies.js.map +1 -1
- package/cache/inmemory/readFromStore.js +2 -2
- package/cache/inmemory/writeToStore.d.ts +1 -1
- package/cache/inmemory/writeToStore.js +4 -4
- package/cache/inmemory/writeToStore.js.map +1 -1
- package/core/ApolloClient.d.ts +774 -180
- package/core/ApolloClient.js +92 -110
- package/core/ApolloClient.js.map +1 -1
- package/core/ObservableQuery.d.ts +120 -68
- package/core/ObservableQuery.js +10 -10
- package/core/ObservableQuery.js.map +1 -1
- package/core/QueryInfo.d.ts +5 -4
- package/core/QueryInfo.js.map +1 -1
- package/core/QueryManager.d.ts +17 -17
- package/core/QueryManager.js +15 -13
- package/core/QueryManager.js.map +1 -1
- 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 +9 -5
- package/core/index.js.map +1 -1
- package/core/types.d.ts +29 -129
- package/core/types.js.map +1 -1
- package/core/watchQueryOptions.d.ts +9 -298
- package/core/watchQueryOptions.js.map +1 -1
- package/dev/setErrorMessageHandler.d.ts +4 -4
- package/dev/setErrorMessageHandler.js.map +1 -1
- package/errors/CombinedGraphQLErrors.d.ts +147 -12
- package/errors/CombinedGraphQLErrors.js +60 -12
- package/errors/CombinedGraphQLErrors.js.map +1 -1
- package/errors/CombinedProtocolErrors.d.ts +127 -3
- package/errors/CombinedProtocolErrors.js +49 -2
- package/errors/CombinedProtocolErrors.js.map +1 -1
- package/errors/LinkError.d.ts +45 -2
- package/errors/LinkError.js +45 -2
- package/errors/LinkError.js.map +1 -1
- package/errors/LocalStateError.d.ts +42 -6
- package/errors/LocalStateError.js +36 -6
- package/errors/LocalStateError.js.map +1 -1
- package/errors/ServerError.d.ts +71 -12
- package/errors/ServerError.js +51 -9
- package/errors/ServerError.js.map +1 -1
- package/errors/ServerParseError.d.ts +72 -17
- package/errors/ServerParseError.js +46 -9
- package/errors/ServerParseError.js.map +1 -1
- package/errors/UnconventionalError.d.ts +46 -2
- package/errors/UnconventionalError.js +46 -2
- package/errors/UnconventionalError.js.map +1 -1
- package/incremental/handlers/notImplemented.js +1 -1
- package/invariantErrorCodes.js +72 -80
- package/link/batch/batchLink.js.map +1 -1
- package/link/batch-http/batchHttpLink.js +1 -1
- package/link/batch-http/batchHttpLink.js.map +1 -1
- package/link/client-awareness/ClientAwarenessLink.d.ts +4 -4
- package/link/client-awareness/ClientAwarenessLink.js.map +1 -1
- package/link/context/index.d.ts +1 -1
- package/link/context/index.js +1 -1
- package/link/context/index.js.map +1 -1
- package/link/core/ApolloLink.js +2 -2
- package/link/core/types.d.ts +2 -2
- package/link/core/types.js.map +1 -1
- package/link/error/index.d.ts +16 -1
- package/link/error/index.js.map +1 -1
- package/link/http/HttpLink.d.ts +2 -1
- package/link/http/HttpLink.js.map +1 -1
- package/link/http/checkFetcher.js +1 -1
- package/link/http/parseAndCheckHttpResponse.js +1 -1
- package/link/http/serializeFetchParameter.js +1 -1
- package/link/persisted-queries/index.d.ts +11 -11
- package/link/persisted-queries/index.js +2 -2
- package/link/persisted-queries/index.js.map +1 -1
- package/link/retry/delayFunction.d.ts +1 -1
- package/link/retry/delayFunction.js.map +1 -1
- package/link/retry/retryFunction.d.ts +1 -1
- package/link/retry/retryFunction.js.map +1 -1
- package/link/retry/retryLink.js.map +1 -1
- package/link/schema/index.js.map +1 -1
- package/link/utils/validateOperation.js +1 -1
- package/link/ws/index.js.map +1 -1
- package/local-state/LocalState.d.ts +94 -0
- package/local-state/LocalState.js +55 -9
- package/local-state/LocalState.js.map +1 -1
- package/masking/GraphQLCodegenDataMasking.d.ts +6 -7
- package/masking/GraphQLCodegenDataMasking.js.map +1 -1
- package/masking/internal/types.d.ts +70 -70
- package/masking/internal/types.js.map +1 -1
- package/masking/maskDefinition.js +2 -2
- package/masking/maskFragment.js +2 -2
- package/masking/maskOperation.js +1 -1
- package/masking/types.js.map +1 -1
- package/masking/utils.js +3 -3
- package/package.json +1 -1
- package/react/context/ApolloContext.js +1 -1
- package/react/context/ApolloProvider.js +1 -1
- package/react/hooks/internal/useDeepMemo.js +0 -3
- package/react/hooks/internal/useDeepMemo.js.map +1 -1
- package/react/hooks/internal/validateSuspenseHookOptions.d.ts +2 -2
- package/react/hooks/internal/validateSuspenseHookOptions.js.map +1 -1
- package/react/hooks/internal/wrapHook.d.ts +8 -7
- package/react/hooks/internal/wrapHook.js +1 -0
- package/react/hooks/internal/wrapHook.js.map +1 -1
- package/react/hooks/useApolloClient.d.ts +2 -2
- package/react/hooks/useApolloClient.js +2 -2
- package/react/hooks/useApolloClient.js.map +1 -1
- package/react/hooks/useBackgroundQuery.d.ts +814 -86
- package/react/hooks/useBackgroundQuery.js.map +1 -1
- package/react/hooks/useFragment.d.ts +54 -3
- package/react/hooks/useFragment.js +7 -0
- package/react/hooks/useFragment.js.map +1 -1
- package/react/hooks/useLazyQuery.d.ts +309 -119
- package/react/hooks/useLazyQuery.js +0 -38
- package/react/hooks/useLazyQuery.js.map +1 -1
- package/react/hooks/useLoadableQuery.d.ts +113 -126
- package/react/hooks/useLoadableQuery.js.map +1 -1
- package/react/hooks/useMutation.d.ts +57 -17
- package/react/hooks/useMutation.js +6 -7
- package/react/hooks/useMutation.js.map +1 -1
- package/react/hooks/useQuery.d.ts +163 -18
- package/react/hooks/useQuery.js +1 -35
- package/react/hooks/useQuery.js.map +1 -1
- package/react/hooks/useQueryRefHandlers.d.ts +21 -1
- package/react/hooks/useQueryRefHandlers.js +2 -1
- package/react/hooks/useQueryRefHandlers.js.map +1 -1
- package/react/hooks/useReactiveVar.d.ts +2 -1
- package/react/hooks/useReactiveVar.js +2 -1
- package/react/hooks/useReactiveVar.js.map +1 -1
- package/react/hooks/useReadQuery.d.ts +96 -17
- package/react/hooks/useReadQuery.js +29 -0
- package/react/hooks/useReadQuery.js.map +1 -1
- package/react/hooks/useSubscription.d.ts +99 -32
- package/react/hooks/useSubscription.js +8 -9
- package/react/hooks/useSubscription.js.map +1 -1
- package/react/hooks/useSuspenseFragment.d.ts +62 -30
- package/react/hooks/useSuspenseFragment.js.map +1 -1
- package/react/hooks/useSuspenseQuery.d.ts +438 -17
- package/react/hooks/useSuspenseQuery.js +4 -1
- package/react/hooks/useSuspenseQuery.js.map +1 -1
- package/react/hooks-compiled/internal/useDeepMemo.js +0 -3
- package/react/hooks-compiled/internal/useDeepMemo.js.map +1 -1
- package/react/hooks-compiled/internal/validateSuspenseHookOptions.d.ts +2 -2
- package/react/hooks-compiled/internal/validateSuspenseHookOptions.js.map +1 -1
- package/react/hooks-compiled/internal/wrapHook.d.ts +8 -7
- package/react/hooks-compiled/internal/wrapHook.js +1 -0
- package/react/hooks-compiled/internal/wrapHook.js.map +1 -1
- package/react/hooks-compiled/useApolloClient.d.ts +2 -2
- package/react/hooks-compiled/useApolloClient.js +2 -2
- package/react/hooks-compiled/useApolloClient.js.map +1 -1
- package/react/hooks-compiled/useBackgroundQuery.d.ts +814 -86
- package/react/hooks-compiled/useBackgroundQuery.js.map +1 -1
- package/react/hooks-compiled/useFragment.d.ts +54 -3
- package/react/hooks-compiled/useFragment.js +7 -0
- package/react/hooks-compiled/useFragment.js.map +1 -1
- package/react/hooks-compiled/useLazyQuery.d.ts +309 -119
- package/react/hooks-compiled/useLazyQuery.js +0 -38
- package/react/hooks-compiled/useLazyQuery.js.map +1 -1
- package/react/hooks-compiled/useLoadableQuery.d.ts +113 -126
- package/react/hooks-compiled/useLoadableQuery.js.map +1 -1
- package/react/hooks-compiled/useMutation.d.ts +57 -17
- package/react/hooks-compiled/useMutation.js +6 -7
- package/react/hooks-compiled/useMutation.js.map +1 -1
- package/react/hooks-compiled/useQuery.d.ts +163 -18
- package/react/hooks-compiled/useQuery.js +1 -35
- package/react/hooks-compiled/useQuery.js.map +1 -1
- package/react/hooks-compiled/useQueryRefHandlers.d.ts +21 -1
- package/react/hooks-compiled/useQueryRefHandlers.js +2 -1
- package/react/hooks-compiled/useQueryRefHandlers.js.map +1 -1
- package/react/hooks-compiled/useReactiveVar.d.ts +2 -1
- package/react/hooks-compiled/useReactiveVar.js +2 -1
- package/react/hooks-compiled/useReactiveVar.js.map +1 -1
- package/react/hooks-compiled/useReadQuery.d.ts +96 -17
- package/react/hooks-compiled/useReadQuery.js +29 -0
- package/react/hooks-compiled/useReadQuery.js.map +1 -1
- package/react/hooks-compiled/useSubscription.d.ts +99 -32
- package/react/hooks-compiled/useSubscription.js +8 -9
- package/react/hooks-compiled/useSubscription.js.map +1 -1
- package/react/hooks-compiled/useSuspenseFragment.d.ts +62 -30
- package/react/hooks-compiled/useSuspenseFragment.js.map +1 -1
- package/react/hooks-compiled/useSuspenseQuery.d.ts +438 -17
- package/react/hooks-compiled/useSuspenseQuery.js.map +1 -1
- package/react/index.compiled.d.ts +0 -1
- package/react/index.compiled.js +0 -1
- package/react/index.compiled.js.map +1 -1
- package/react/index.d.ts +0 -1
- package/react/index.js +0 -1
- package/react/index.js.map +1 -1
- package/react/index.react-server.d.ts +0 -1
- package/react/index.react-server.js +0 -2
- package/react/index.react-server.js.map +1 -1
- package/react/internal/cache/FragmentReference.d.ts +2 -3
- package/react/internal/cache/FragmentReference.js.map +1 -1
- package/react/internal/cache/QueryReference.d.ts +11 -11
- package/react/internal/cache/QueryReference.js.map +1 -1
- package/react/internal/cache/SuspenseCache.d.ts +2 -2
- package/react/internal/cache/SuspenseCache.js.map +1 -1
- package/react/internal/cache/getSuspenseCache.d.ts +6 -4
- package/react/internal/cache/getSuspenseCache.js.map +1 -1
- package/react/internal/index.d.ts +1 -1
- package/react/internal/index.js +1 -0
- package/react/internal/index.js.map +1 -1
- package/react/internal/types.d.ts +3 -3
- package/react/internal/types.js.map +1 -1
- package/react/query-preloader/createQueryPreloader.d.ts +31 -31
- package/react/query-preloader/createQueryPreloader.js +1 -1
- package/react/query-preloader/createQueryPreloader.js.map +1 -1
- package/react/ssr/prerenderStatic.d.ts +11 -9
- package/react/ssr/prerenderStatic.js +5 -4
- package/react/ssr/prerenderStatic.js.map +1 -1
- package/react/ssr/useSSRQuery.js.map +1 -1
- package/react/types/deprecated.d.ts +1 -1
- package/react/types/deprecated.js.map +1 -1
- package/react/types/types.documentation.d.ts +10 -10
- package/react/types/types.documentation.js.map +1 -1
- package/testing/core/mocking/mockLink.d.ts +3 -2
- package/testing/core/mocking/mockLink.js.map +1 -1
- package/testing/core/types/deprecated.d.ts +3 -2
- package/testing/core/types/deprecated.js.map +1 -1
- package/testing/react/MockedProvider.d.ts +2 -3
- package/testing/react/MockedProvider.js.map +1 -1
- package/utilities/HKT.d.ts +8 -7
- package/utilities/HKT.js.map +1 -1
- package/utilities/caching/sizes.d.ts +4 -6
- package/utilities/caching/sizes.js +3 -3
- package/utilities/caching/sizes.js.map +1 -1
- package/utilities/graphql/DocumentTransform.js +1 -1
- package/utilities/graphql/DocumentTransform.js.map +1 -1
- package/utilities/index.d.ts +1 -2
- package/utilities/index.js +1 -2
- package/utilities/index.js.map +1 -1
- package/utilities/{shared → internal}/canonicalStringify.d.ts +1 -1
- package/utilities/{shared → internal}/canonicalStringify.js +4 -6
- package/utilities/internal/canonicalStringify.js.map +1 -0
- package/utilities/internal/checkDocument.js +1 -1
- package/utilities/internal/checkDocument.js.map +1 -1
- package/utilities/internal/createFragmentMap.js.map +1 -1
- package/utilities/internal/equalByQuery.d.ts +5 -0
- package/{core → utilities/internal}/equalByQuery.js +7 -1
- package/utilities/internal/equalByQuery.js.map +1 -0
- package/utilities/internal/getFragmentQueryDocument.d.ts +13 -3
- package/utilities/internal/getFragmentQueryDocument.js +13 -3
- package/utilities/internal/getFragmentQueryDocument.js.map +1 -1
- package/utilities/internal/getMemoryInternals.js.map +1 -1
- package/utilities/internal/getStoreKeyName.js +1 -2
- package/utilities/internal/getStoreKeyName.js.map +1 -1
- package/utilities/internal/index.d.ts +2 -0
- package/utilities/internal/index.js +2 -0
- package/utilities/internal/index.js.map +1 -1
- package/utilities/internal/mergeOptions.d.ts +2 -2
- package/utilities/internal/mergeOptions.js.map +1 -1
- package/utilities/internal/toQueryResult.d.ts +2 -2
- package/utilities/internal/toQueryResult.js.map +1 -1
- package/utilities/internal/types/DocumentationTypes.d.ts +16 -2
- package/utilities/internal/types/DocumentationTypes.js.map +1 -1
- package/utilities/internal/types/NoInfer.d.ts +31 -25
- package/utilities/internal/types/NoInfer.js.map +1 -1
- package/utilities/subscriptions/relay/index.js +2 -0
- package/utilities/subscriptions/relay/index.js.map +1 -1
- package/version.js +1 -1
- package/__cjs/cache/core/types/DataProxy.cjs.map +0 -1
- package/__cjs/cache/core/types/DataProxy.d.cts +0 -140
- package/__cjs/core/equalByQuery.cjs.map +0 -1
- package/__cjs/core/equalByQuery.d.cts +0 -4
- package/__cjs/react/context/ApolloConsumer.cjs +0 -16
- package/__cjs/react/context/ApolloConsumer.cjs.map +0 -1
- package/__cjs/react/context/ApolloConsumer.d.cts +0 -10
- package/__cjs/utilities/shared/canonicalStringify.cjs.map +0 -1
- package/cache/core/types/DataProxy.d.ts +0 -140
- package/cache/core/types/DataProxy.js +0 -2
- package/cache/core/types/DataProxy.js.map +0 -1
- package/core/equalByQuery.d.ts +0 -4
- package/core/equalByQuery.js.map +0 -1
- package/react/context/ApolloConsumer.d.ts +0 -10
- package/react/context/ApolloConsumer.js +0 -11
- package/react/context/ApolloConsumer.js.map +0 -1
- package/utilities/shared/canonicalStringify.js.map +0 -1
|
@@ -1,106 +1,669 @@
|
|
|
1
|
+
import type { DocumentNode } from "graphql";
|
|
1
2
|
import type { Observable } from "rxjs";
|
|
2
|
-
import type { ApolloCache,
|
|
3
|
-
import type { WatchFragmentOptions, WatchFragmentResult } from "@apollo/client/cache";
|
|
3
|
+
import type { ApolloCache, IgnoreModifier, Reference } from "@apollo/client/cache";
|
|
4
4
|
import type { Incremental } from "@apollo/client/incremental";
|
|
5
5
|
import type { ApolloLink, FetchResult, GraphQLRequest } from "@apollo/client/link";
|
|
6
6
|
import type { ClientAwarenessLink } from "@apollo/client/link/client-awareness";
|
|
7
7
|
import type { LocalState } from "@apollo/client/local-state";
|
|
8
8
|
import type { MaybeMasked, Unmasked } from "@apollo/client/masking";
|
|
9
9
|
import { DocumentTransform } from "@apollo/client/utilities";
|
|
10
|
+
import type { VariablesOption } from "@apollo/client/utilities/internal";
|
|
10
11
|
import { getApolloClientMemoryInternals } from "@apollo/client/utilities/internal";
|
|
11
12
|
import type { ObservableQuery } from "./ObservableQuery.cjs";
|
|
12
|
-
import type { DefaultContext,
|
|
13
|
-
import type {
|
|
14
|
-
export
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
13
|
+
import type { DefaultContext, ErrorLike, InternalRefetchQueriesInclude, InternalRefetchQueriesResult, MutationQueryReducersMap, MutationUpdaterFunction, NormalizedExecutionResult, OnQueryUpdated, OperationVariables, RefetchQueriesInclude, RefetchQueriesPromiseResults, SubscriptionObservable, TypedDocumentNode } from "./types.cjs";
|
|
14
|
+
import type { ErrorPolicy, FetchPolicy, MutationFetchPolicy, NextFetchPolicyContext, RefetchWritePolicy, WatchQueryFetchPolicy } from "./watchQueryOptions.cjs";
|
|
15
|
+
export declare namespace ApolloClient {
|
|
16
|
+
interface DefaultOptions {
|
|
17
|
+
watchQuery?: Partial<ApolloClient.WatchQueryOptions<any, any>>;
|
|
18
|
+
query?: Partial<ApolloClient.QueryOptions<any, any>>;
|
|
19
|
+
mutate?: Partial<ApolloClient.MutateOptions<any, any, any>>;
|
|
20
|
+
}
|
|
21
|
+
interface Options {
|
|
22
|
+
/**
|
|
23
|
+
* An `ApolloLink` instance to serve as Apollo Client's network layer. For more information, see [Advanced HTTP networking](https://www.apollographql.com/docs/react/networking/advanced-http-networking/).
|
|
24
|
+
*/
|
|
25
|
+
link: ApolloLink;
|
|
26
|
+
/**
|
|
27
|
+
* The cache that Apollo Client should use to store query results locally. The recommended cache is `InMemoryCache`, which is provided by the `@apollo/client` package.
|
|
28
|
+
*
|
|
29
|
+
* For more information, see [Configuring the cache](https://www.apollographql.com/docs/react/caching/cache-configuration/).
|
|
30
|
+
*/
|
|
31
|
+
cache: ApolloCache;
|
|
32
|
+
/**
|
|
33
|
+
* The time interval (in milliseconds) before Apollo Client force-fetches queries after a server-side render.
|
|
34
|
+
*
|
|
35
|
+
* @defaultValue `0` (no delay)
|
|
36
|
+
*/
|
|
37
|
+
ssrForceFetchDelay?: number;
|
|
38
|
+
/**
|
|
39
|
+
* When using Apollo Client for [server-side rendering](https://www.apollographql.com/docs/react/performance/server-side-rendering/), set this to `true` so that the [`getDataFromTree` function](../react/ssr/#getdatafromtree) can work effectively.
|
|
40
|
+
*
|
|
41
|
+
* @defaultValue `false`
|
|
42
|
+
*/
|
|
43
|
+
ssrMode?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* If `false`, Apollo Client sends every created query to the server, even if a _completely_ identical query (identical in terms of query string, variable values, and operationName) is already in flight.
|
|
46
|
+
*
|
|
47
|
+
* @defaultValue `true`
|
|
48
|
+
*/
|
|
49
|
+
queryDeduplication?: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Provide this object to set application-wide default values for options you can provide to the `watchQuery`, `query`, and `mutate` functions. See below for an example object.
|
|
52
|
+
*
|
|
53
|
+
* See this [example object](https://www.apollographql.com/docs/react/api/core/ApolloClient#example-defaultoptions-object).
|
|
54
|
+
*/
|
|
55
|
+
defaultOptions?: ApolloClient.DefaultOptions;
|
|
56
|
+
defaultContext?: Partial<DefaultContext>;
|
|
57
|
+
/**
|
|
58
|
+
* If `true`, Apollo Client will assume results read from the cache are never mutated by application code, which enables substantial performance optimizations.
|
|
59
|
+
*
|
|
60
|
+
* @defaultValue `false`
|
|
61
|
+
*/
|
|
62
|
+
assumeImmutableResults?: boolean;
|
|
63
|
+
localState?: LocalState;
|
|
64
|
+
/**
|
|
65
|
+
*
|
|
66
|
+
*/
|
|
67
|
+
clientAwareness?: ClientAwarenessLink.ClientAwarenessOptions;
|
|
68
|
+
/**
|
|
69
|
+
*
|
|
70
|
+
*/
|
|
71
|
+
enhancedClientAwareness?: ClientAwarenessLink.EnhancedClientAwarenessOptions;
|
|
72
|
+
documentTransform?: DocumentTransform;
|
|
73
|
+
/**
|
|
74
|
+
* Configuration used by the [Apollo Client Devtools extension](https://www.apollographql.com/docs/react/development-testing/developer-tooling/#apollo-client-devtools) for this client.
|
|
75
|
+
*
|
|
76
|
+
* @since 3.11.0
|
|
77
|
+
*/
|
|
78
|
+
devtools?: DevtoolsOptions;
|
|
79
|
+
/**
|
|
80
|
+
* Determines if data masking is enabled for the client.
|
|
81
|
+
*
|
|
82
|
+
* @defaultValue false
|
|
83
|
+
*/
|
|
84
|
+
dataMasking?: boolean;
|
|
85
|
+
/**
|
|
86
|
+
* Determines the strategy used to parse incremental chunks from `@defer`
|
|
87
|
+
* queries.
|
|
88
|
+
*/
|
|
89
|
+
incrementalHandler?: Incremental.Handler<any>;
|
|
90
|
+
}
|
|
91
|
+
interface DevtoolsOptions {
|
|
92
|
+
/**
|
|
93
|
+
* If `true`, the [Apollo Client Devtools](https://www.apollographql.com/docs/react/development-testing/developer-tooling/#apollo-client-devtools) browser extension can connect to this `ApolloClient` instance.
|
|
94
|
+
*
|
|
95
|
+
* The default value is `false` in production and `true` in development if there is a `window` object.
|
|
96
|
+
*/
|
|
97
|
+
enabled?: boolean;
|
|
98
|
+
/**
|
|
99
|
+
* Optional name for this `ApolloClient` instance in the devtools. This is
|
|
100
|
+
* useful when you instantiate multiple clients and want to be able to
|
|
101
|
+
* identify them by name.
|
|
102
|
+
*/
|
|
103
|
+
name?: string;
|
|
104
|
+
}
|
|
105
|
+
type MutateOptions<TData = unknown, TVariables extends OperationVariables = OperationVariables, TCache extends ApolloCache = ApolloCache> = {
|
|
106
|
+
/**
|
|
107
|
+
* By providing either an object or a callback function that, when invoked after a mutation, allows you to return optimistic data and optionally skip updates via the `IGNORE` sentinel object, Apollo Client caches this temporary (and potentially incorrect) response until the mutation completes, enabling more responsive UI updates.
|
|
108
|
+
*
|
|
109
|
+
* For more information, see [Optimistic mutation results](https://www.apollographql.com/docs/react/performance/optimistic-ui/).
|
|
110
|
+
*
|
|
111
|
+
* @docGroup
|
|
112
|
+
*
|
|
113
|
+
* 3. Caching options
|
|
114
|
+
*/
|
|
115
|
+
optimisticResponse?: Unmasked<NoInfer<TData>> | ((vars: TVariables, { IGNORE }: {
|
|
116
|
+
IGNORE: IgnoreModifier;
|
|
117
|
+
}) => Unmasked<NoInfer<TData>> | IgnoreModifier);
|
|
118
|
+
/**
|
|
119
|
+
* A `MutationQueryReducersMap`, which is map from query names to mutation query reducers. Briefly, this map defines how to incorporate the results of the mutation into the results of queries that are currently being watched by your application.
|
|
120
|
+
*/
|
|
121
|
+
updateQueries?: MutationQueryReducersMap<TData>;
|
|
122
|
+
/**
|
|
123
|
+
* An array (or a function that _returns_ an array) that specifies which queries you want to refetch after the mutation occurs.
|
|
124
|
+
*
|
|
125
|
+
* Each array value can be either:
|
|
126
|
+
*
|
|
127
|
+
* - An object containing the `query` to execute, along with any `variables`
|
|
128
|
+
*
|
|
129
|
+
* - A string indicating the operation name of the query to refetch
|
|
130
|
+
*
|
|
131
|
+
* @docGroup
|
|
132
|
+
*
|
|
133
|
+
* 1. Operation options
|
|
134
|
+
*/
|
|
135
|
+
refetchQueries?: ((result: NormalizedExecutionResult<Unmasked<TData>>) => InternalRefetchQueriesInclude) | InternalRefetchQueriesInclude;
|
|
136
|
+
/**
|
|
137
|
+
* If `true`, makes sure all queries included in `refetchQueries` are completed before the mutation is considered complete.
|
|
138
|
+
*
|
|
139
|
+
* The default value is `false` (queries are refetched asynchronously).
|
|
140
|
+
*
|
|
141
|
+
* @docGroup
|
|
142
|
+
*
|
|
143
|
+
* 1. Operation options
|
|
144
|
+
*/
|
|
145
|
+
awaitRefetchQueries?: boolean;
|
|
146
|
+
/**
|
|
147
|
+
* A function used to update the Apollo Client cache after the mutation completes.
|
|
148
|
+
*
|
|
149
|
+
* For more information, see [Updating the cache after a mutation](https://www.apollographql.com/docs/react/data/mutations#updating-the-cache-after-a-mutation).
|
|
150
|
+
*
|
|
151
|
+
* @docGroup
|
|
152
|
+
*
|
|
153
|
+
* 3. Caching options
|
|
154
|
+
*/
|
|
155
|
+
update?: MutationUpdaterFunction<TData, TVariables, TCache>;
|
|
156
|
+
/**
|
|
157
|
+
* Optional callback for intercepting queries whose cache data has been updated by the mutation, as well as any queries specified in the `refetchQueries: [...]` list passed to `client.mutate`.
|
|
158
|
+
*
|
|
159
|
+
* Returning a `Promise` from `onQueryUpdated` will cause the final mutation `Promise` to await the returned `Promise`. Returning `false` causes the query to be ignored.
|
|
160
|
+
*
|
|
161
|
+
* @docGroup
|
|
162
|
+
*
|
|
163
|
+
* 1. Operation options
|
|
164
|
+
*/
|
|
165
|
+
onQueryUpdated?: OnQueryUpdated<any>;
|
|
166
|
+
/**
|
|
167
|
+
* Specifies how the mutation handles a response that returns both GraphQL errors and partial results.
|
|
168
|
+
*
|
|
169
|
+
* For details, see [GraphQL error policies](https://www.apollographql.com/docs/react/data/error-handling/#graphql-error-policies).
|
|
170
|
+
*
|
|
171
|
+
* The default value is `none`, meaning that the mutation result includes error details but _not_ partial results.
|
|
172
|
+
*
|
|
173
|
+
* @docGroup
|
|
174
|
+
*
|
|
175
|
+
* 1. Operation options
|
|
176
|
+
*/
|
|
177
|
+
errorPolicy?: ErrorPolicy;
|
|
178
|
+
/**
|
|
179
|
+
* If you're using [Apollo Link](https://www.apollographql.com/docs/react/api/link/introduction/), this object is the initial value of the `context` object that's passed along your link chain.
|
|
180
|
+
*
|
|
181
|
+
* @docGroup
|
|
182
|
+
*
|
|
183
|
+
* 2. Networking options
|
|
184
|
+
*/
|
|
185
|
+
context?: DefaultContext;
|
|
186
|
+
/**
|
|
187
|
+
* Provide `no-cache` if the mutation's result should _not_ be written to the Apollo Client cache.
|
|
188
|
+
*
|
|
189
|
+
* The default value is `network-only` (which means the result _is_ written to the cache).
|
|
190
|
+
*
|
|
191
|
+
* Unlike queries, mutations _do not_ support [fetch policies](https://www.apollographql.com/docs/react/data/queries/#setting-a-fetch-policy) besides `network-only` and `no-cache`.
|
|
192
|
+
*
|
|
193
|
+
* @docGroup
|
|
194
|
+
*
|
|
195
|
+
* 3. Caching options
|
|
196
|
+
*/
|
|
197
|
+
fetchPolicy?: MutationFetchPolicy;
|
|
198
|
+
/**
|
|
199
|
+
* To avoid retaining sensitive information from mutation root field arguments, Apollo Client v3.4+ automatically clears any `ROOT_MUTATION` fields from the cache after each mutation finishes. If you need this information to remain in the cache, you can prevent the removal by passing `keepRootFields: true` to the mutation. `ROOT_MUTATION` result data are also passed to the mutation `update` function, so we recommend obtaining the results that way, rather than using this option, if possible.
|
|
200
|
+
*/
|
|
201
|
+
keepRootFields?: boolean;
|
|
202
|
+
/**
|
|
203
|
+
* A GraphQL document, often created with `gql` from the `graphql-tag` package, that contains a single mutation inside of it.
|
|
204
|
+
*
|
|
205
|
+
* @docGroup
|
|
206
|
+
*
|
|
207
|
+
* 1. Operation options
|
|
208
|
+
*/
|
|
209
|
+
mutation: DocumentNode | TypedDocumentNode<TData, TVariables>;
|
|
210
|
+
} & VariablesOption<NoInfer<TVariables>>;
|
|
211
|
+
interface MutateResult<TData = unknown> {
|
|
212
|
+
/**
|
|
213
|
+
* The data returned from your mutation. Can be `undefined` if `ignoreResults` is `true`.
|
|
214
|
+
*/
|
|
215
|
+
data: TData | undefined;
|
|
216
|
+
/**
|
|
217
|
+
* If the mutation produces one or more errors, this object contains either an array of `graphQLErrors` or a single `networkError`. Otherwise, this value is `undefined`.
|
|
218
|
+
*
|
|
219
|
+
* For more information, see [Handling operation errors](https://www.apollographql.com/docs/react/data/error-handling/).
|
|
220
|
+
*/
|
|
221
|
+
error?: ErrorLike;
|
|
222
|
+
/**
|
|
223
|
+
* Custom extensions returned from the GraphQL server
|
|
224
|
+
*/
|
|
225
|
+
extensions?: Record<string, unknown>;
|
|
226
|
+
}
|
|
46
227
|
/**
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
* @defaultValue `0` (no delay)
|
|
228
|
+
* Query options.
|
|
50
229
|
*/
|
|
51
|
-
|
|
230
|
+
type QueryOptions<TData = unknown, TVariables extends OperationVariables = OperationVariables> = {
|
|
231
|
+
/**
|
|
232
|
+
* A GraphQL query string parsed into an AST with the gql template literal.
|
|
233
|
+
*
|
|
234
|
+
* @docGroup
|
|
235
|
+
*
|
|
236
|
+
* 1. Operation options
|
|
237
|
+
*/
|
|
238
|
+
query: DocumentNode | TypedDocumentNode<TData, TVariables>;
|
|
239
|
+
/**
|
|
240
|
+
* Specifies how the query handles a response that returns both GraphQL errors and partial results.
|
|
241
|
+
*
|
|
242
|
+
* For details, see [GraphQL error policies](https://www.apollographql.com/docs/react/data/error-handling/#graphql-error-policies).
|
|
243
|
+
*
|
|
244
|
+
* The default value is `none`, meaning that the query result includes error details but not partial results.
|
|
245
|
+
*
|
|
246
|
+
* @docGroup
|
|
247
|
+
*
|
|
248
|
+
* 1. Operation options
|
|
249
|
+
*/
|
|
250
|
+
errorPolicy?: ErrorPolicy;
|
|
251
|
+
/**
|
|
252
|
+
* If you're using [Apollo Link](https://www.apollographql.com/docs/react/api/link/introduction/), this object is the initial value of the `context` object that's passed along your link chain.
|
|
253
|
+
*
|
|
254
|
+
* @docGroup
|
|
255
|
+
*
|
|
256
|
+
* 2. Networking options
|
|
257
|
+
*/
|
|
258
|
+
context?: DefaultContext;
|
|
259
|
+
/**
|
|
260
|
+
* Specifies how the query interacts with the Apollo Client cache during execution (for example, whether it checks the cache for results before sending a request to the server).
|
|
261
|
+
*
|
|
262
|
+
* For details, see [Setting a fetch policy](https://www.apollographql.com/docs/react/data/queries/#setting-a-fetch-policy).
|
|
263
|
+
*
|
|
264
|
+
* The default value is `cache-first`.
|
|
265
|
+
*
|
|
266
|
+
* @docGroup
|
|
267
|
+
*
|
|
268
|
+
* 3. Caching options
|
|
269
|
+
*/
|
|
270
|
+
fetchPolicy?: FetchPolicy;
|
|
271
|
+
} & VariablesOption<NoInfer<TVariables>>;
|
|
272
|
+
interface QueryResult<TData = unknown> {
|
|
273
|
+
/**
|
|
274
|
+
* An object containing the result of your GraphQL query after it completes.
|
|
275
|
+
*
|
|
276
|
+
* This value might be `undefined` if a query results in one or more errors (depending on the query's `errorPolicy`).
|
|
277
|
+
*
|
|
278
|
+
* @docGroup
|
|
279
|
+
*
|
|
280
|
+
* 1. Operation data
|
|
281
|
+
*/
|
|
282
|
+
data: TData | undefined;
|
|
283
|
+
/**
|
|
284
|
+
* A single ErrorLike object describing the error that occured during the latest query execution.
|
|
285
|
+
*
|
|
286
|
+
* For more information, see [Handling operation errors](https://www.apollographql.com/docs/react/data/error-handling/).
|
|
287
|
+
*
|
|
288
|
+
* @docGroup
|
|
289
|
+
*
|
|
290
|
+
* 1. Operation data
|
|
291
|
+
*/
|
|
292
|
+
error?: ErrorLike;
|
|
293
|
+
}
|
|
52
294
|
/**
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
* @defaultValue `false`
|
|
295
|
+
* Options object for the `client.refetchQueries` method.
|
|
56
296
|
*/
|
|
57
|
-
|
|
297
|
+
interface RefetchQueriesOptions<TCache extends ApolloCache, TResult> {
|
|
298
|
+
/**
|
|
299
|
+
* Optional function that updates cached fields to trigger refetches of queries that include those fields.
|
|
300
|
+
*/
|
|
301
|
+
updateCache?: (cache: TCache) => void;
|
|
302
|
+
/**
|
|
303
|
+
* Optional array specifying queries to refetch. Each element can be either a query's string name or a `DocumentNode` object.
|
|
304
|
+
*
|
|
305
|
+
* Pass `"active"` as a shorthand to refetch all active queries, or `"all"` to refetch all active and inactive queries.
|
|
306
|
+
*
|
|
307
|
+
* Analogous to the [`options.refetchQueries`](https://www.apollographql.com/docs/react/data/mutations/#options) array for mutations.
|
|
308
|
+
*/
|
|
309
|
+
include?: RefetchQueriesInclude;
|
|
310
|
+
/**
|
|
311
|
+
* If `true`, the `options.updateCache` function is executed on a temporary optimistic layer of `InMemoryCache`, so its modifications can be discarded from the cache after observing which fields it invalidated.
|
|
312
|
+
*
|
|
313
|
+
* Defaults to `false`, meaning `options.updateCache` updates the cache in a lasting way.
|
|
314
|
+
*/
|
|
315
|
+
optimistic?: boolean;
|
|
316
|
+
/**
|
|
317
|
+
* Optional callback function that's called once for each `ObservableQuery` that's either affected by `options.updateCache` or listed in `options.include` (or both).
|
|
318
|
+
*
|
|
319
|
+
* If `onQueryUpdated` is not provided, the default implementation returns the result of calling `observableQuery.refetch()`. When `onQueryUpdated` is provided, it can dynamically decide whether (and how) each query should be refetched.
|
|
320
|
+
*
|
|
321
|
+
* Returning `false` from `onQueryUpdated` prevents the associated query from being refetched.
|
|
322
|
+
*/
|
|
323
|
+
onQueryUpdated?: OnQueryUpdated<TResult> | null;
|
|
324
|
+
}
|
|
58
325
|
/**
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
|
|
63
|
-
queryDeduplication?: boolean;
|
|
64
|
-
/**
|
|
65
|
-
* Provide this object to set application-wide default values for options you can provide to the `watchQuery`, `query`, and `mutate` functions. See below for an example object.
|
|
66
|
-
*
|
|
67
|
-
* See this [example object](https://www.apollographql.com/docs/react/api/core/ApolloClient#example-defaultoptions-object).
|
|
326
|
+
* The result of client.refetchQueries is thenable/awaitable, if you just want
|
|
327
|
+
* an array of fully resolved results, but you can also access the raw results
|
|
328
|
+
* immediately by examining the additional `queries` and `results` properties of
|
|
329
|
+
* the `RefetchQueriesResult<TResult> object`.
|
|
68
330
|
*/
|
|
69
|
-
|
|
70
|
-
|
|
331
|
+
interface RefetchQueriesResult<TResult> extends Promise<RefetchQueriesPromiseResults<TResult>>, RefetchQueriesResult.AdditionalProperties<TResult> {
|
|
332
|
+
}
|
|
333
|
+
namespace RefetchQueriesResult {
|
|
334
|
+
interface AdditionalProperties<TResult> {
|
|
335
|
+
/**
|
|
336
|
+
* An array of ObservableQuery objects corresponding 1:1 to TResult values
|
|
337
|
+
* in the results arrays (both the `result` property and the resolved value).
|
|
338
|
+
*/
|
|
339
|
+
queries: ObservableQuery<any>[];
|
|
340
|
+
/**
|
|
341
|
+
* An array of results that were either returned by `onQueryUpdated`, or provided by default in the absence of `onQueryUpdated`, including pending promises.
|
|
342
|
+
*
|
|
343
|
+
* If `onQueryUpdated` returns `false` for a given query, no result is provided for that query.
|
|
344
|
+
*
|
|
345
|
+
* If `onQueryUpdated` returns `true`, the resulting `Promise<ApolloQueryResult<any>>` is included in the `results` array instead of `true`.
|
|
346
|
+
*/
|
|
347
|
+
results: InternalRefetchQueriesResult<TResult>[];
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
type SubscribeOptions<TData = unknown, TVariables extends OperationVariables = OperationVariables> = {
|
|
351
|
+
/**
|
|
352
|
+
* A GraphQL document, often created with `gql` from the `graphql-tag` package, that contains a single subscription inside of it.
|
|
353
|
+
*/
|
|
354
|
+
query: DocumentNode | TypedDocumentNode<TData, TVariables>;
|
|
355
|
+
/**
|
|
356
|
+
* How you want your component to interact with the Apollo cache. For details, see [Setting a fetch policy](https://www.apollographql.com/docs/react/data/queries/#setting-a-fetch-policy).
|
|
357
|
+
*/
|
|
358
|
+
fetchPolicy?: FetchPolicy;
|
|
359
|
+
/**
|
|
360
|
+
* Specifies the `ErrorPolicy` to be used for this operation
|
|
361
|
+
*/
|
|
362
|
+
errorPolicy?: ErrorPolicy;
|
|
363
|
+
/**
|
|
364
|
+
* Shared context between your component and your network interface (Apollo Link).
|
|
365
|
+
*/
|
|
366
|
+
context?: DefaultContext;
|
|
367
|
+
/**
|
|
368
|
+
* Shared context between your component and your network interface (Apollo Link).
|
|
369
|
+
*/
|
|
370
|
+
extensions?: Record<string, any>;
|
|
371
|
+
} & VariablesOption<NoInfer<TVariables>>;
|
|
372
|
+
interface SubscribeResult<TData = unknown> {
|
|
373
|
+
/**
|
|
374
|
+
* The data returned from your mutation. Can be `undefined` if `ignoreResults` is `true`.
|
|
375
|
+
*/
|
|
376
|
+
data: TData | undefined;
|
|
377
|
+
/**
|
|
378
|
+
* If the mutation produces one or more errors, this object contains either an array of `graphQLErrors` or a single `networkError`. Otherwise, this value is `undefined`.
|
|
379
|
+
*
|
|
380
|
+
* For more information, see [Handling operation errors](https://www.apollographql.com/docs/react/data/error-handling/).
|
|
381
|
+
*/
|
|
382
|
+
error?: ErrorLike;
|
|
383
|
+
/**
|
|
384
|
+
* Custom extensions returned from the GraphQL server
|
|
385
|
+
*/
|
|
386
|
+
extensions?: Record<string, unknown>;
|
|
387
|
+
}
|
|
388
|
+
type WatchFragmentOptions<TData = unknown, TVariables extends OperationVariables = OperationVariables> = ApolloCache.WatchFragmentOptions<TData, TVariables>;
|
|
389
|
+
type WatchFragmentResult<TData = unknown> = ApolloCache.WatchFragmentResult<TData>;
|
|
71
390
|
/**
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
* @defaultValue `false`
|
|
391
|
+
* Watched query options.
|
|
75
392
|
*/
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
393
|
+
type WatchQueryOptions<TData = unknown, TVariables extends OperationVariables = OperationVariables> = {
|
|
394
|
+
/**
|
|
395
|
+
* Specifies how the query interacts with the Apollo Client cache during execution (for example, whether it checks the cache for results before sending a request to the server).
|
|
396
|
+
*
|
|
397
|
+
* For details, see [Setting a fetch policy](https://www.apollographql.com/docs/react/data/queries/#setting-a-fetch-policy).
|
|
398
|
+
*
|
|
399
|
+
* The default value is `cache-first`.
|
|
400
|
+
*
|
|
401
|
+
* @docGroup
|
|
402
|
+
*
|
|
403
|
+
* 3. Caching options
|
|
404
|
+
*/
|
|
405
|
+
fetchPolicy?: WatchQueryFetchPolicy;
|
|
406
|
+
/**
|
|
407
|
+
* Specifies the `FetchPolicy` to be used after this query has completed.
|
|
408
|
+
*
|
|
409
|
+
* @docGroup
|
|
410
|
+
*
|
|
411
|
+
* 3. Caching options
|
|
412
|
+
*/
|
|
413
|
+
nextFetchPolicy?: WatchQueryFetchPolicy | ((this: WatchQueryOptions<TData, TVariables>, currentFetchPolicy: WatchQueryFetchPolicy, context: NextFetchPolicyContext<TData, TVariables>) => WatchQueryFetchPolicy);
|
|
414
|
+
/**
|
|
415
|
+
* Defaults to the initial value of options.fetchPolicy, but can be explicitly configured to specify the WatchQueryFetchPolicy to revert back to whenever variables change (unless nextFetchPolicy intervenes).
|
|
416
|
+
*
|
|
417
|
+
* @docGroup
|
|
418
|
+
*
|
|
419
|
+
* 3. Caching options
|
|
420
|
+
*/
|
|
421
|
+
initialFetchPolicy?: WatchQueryFetchPolicy;
|
|
422
|
+
/**
|
|
423
|
+
* Specifies whether a `NetworkStatus.refetch` operation should merge incoming field data with existing data, or overwrite the existing data. Overwriting is probably preferable, but merging is currently the default behavior, for backwards compatibility with Apollo Client 3.x.
|
|
424
|
+
*
|
|
425
|
+
* @docGroup
|
|
426
|
+
*
|
|
427
|
+
* 3. Caching options
|
|
428
|
+
*/
|
|
429
|
+
refetchWritePolicy?: RefetchWritePolicy;
|
|
430
|
+
/**
|
|
431
|
+
* Specifies how the query handles a response that returns both GraphQL errors and partial results.
|
|
432
|
+
*
|
|
433
|
+
* For details, see [GraphQL error policies](https://www.apollographql.com/docs/react/data/error-handling/#graphql-error-policies).
|
|
434
|
+
*
|
|
435
|
+
* The default value is `none`, meaning that the query result includes error details but not partial results.
|
|
436
|
+
*
|
|
437
|
+
* @docGroup
|
|
438
|
+
*
|
|
439
|
+
* 1. Operation options
|
|
440
|
+
*/
|
|
441
|
+
errorPolicy?: ErrorPolicy;
|
|
442
|
+
/**
|
|
443
|
+
* If you're using [Apollo Link](https://www.apollographql.com/docs/react/api/link/introduction/), this object is the initial value of the `context` object that's passed along your link chain.
|
|
444
|
+
*
|
|
445
|
+
* @docGroup
|
|
446
|
+
*
|
|
447
|
+
* 2. Networking options
|
|
448
|
+
*/
|
|
449
|
+
context?: DefaultContext;
|
|
450
|
+
/**
|
|
451
|
+
* Specifies the interval (in milliseconds) at which the query polls for updated results.
|
|
452
|
+
*
|
|
453
|
+
* The default value is `0` (no polling).
|
|
454
|
+
*
|
|
455
|
+
* @docGroup
|
|
456
|
+
*
|
|
457
|
+
* 2. Networking options
|
|
458
|
+
*/
|
|
459
|
+
pollInterval?: number;
|
|
460
|
+
/**
|
|
461
|
+
* If `true`, the in-progress query's associated component re-renders whenever the network status changes or a network error occurs.
|
|
462
|
+
*
|
|
463
|
+
* The default value is `true`.
|
|
464
|
+
*
|
|
465
|
+
* @docGroup
|
|
466
|
+
*
|
|
467
|
+
* 2. Networking options
|
|
468
|
+
*/
|
|
469
|
+
notifyOnNetworkStatusChange?: boolean;
|
|
470
|
+
/**
|
|
471
|
+
* If `true`, the query can return partial results from the cache if the cache doesn't contain results for all queried fields.
|
|
472
|
+
*
|
|
473
|
+
* The default value is `false`.
|
|
474
|
+
*
|
|
475
|
+
* @docGroup
|
|
476
|
+
*
|
|
477
|
+
* 3. Caching options
|
|
478
|
+
*/
|
|
479
|
+
returnPartialData?: boolean;
|
|
480
|
+
/**
|
|
481
|
+
* A callback function that's called whenever a refetch attempt occurs while polling. If the function returns `true`, the refetch is skipped and not reattempted until the next poll interval.
|
|
482
|
+
*
|
|
483
|
+
* @docGroup
|
|
484
|
+
*
|
|
485
|
+
* 2. Networking options
|
|
486
|
+
*/
|
|
487
|
+
skipPollAttempt?: () => boolean;
|
|
488
|
+
/**
|
|
489
|
+
* A GraphQL query string parsed into an AST with the gql template literal.
|
|
490
|
+
*
|
|
491
|
+
* @docGroup
|
|
492
|
+
*
|
|
493
|
+
* 1. Operation options
|
|
494
|
+
*/
|
|
495
|
+
query: DocumentNode | TypedDocumentNode<TData, TVariables>;
|
|
496
|
+
} & VariablesOption<NoInfer<TVariables>>;
|
|
497
|
+
namespace Base {
|
|
498
|
+
interface ReadQueryOptions<TData, TVariables extends OperationVariables> {
|
|
499
|
+
/**
|
|
500
|
+
* The GraphQL query shape to be used constructed using the `gql` template
|
|
501
|
+
* string tag. The query will be used to determine the
|
|
502
|
+
* shape of the data to be read.
|
|
503
|
+
*/
|
|
504
|
+
query: DocumentNode | TypedDocumentNode<TData, TVariables>;
|
|
505
|
+
/**
|
|
506
|
+
* The root id to be used. Defaults to "ROOT_QUERY", which is the ID of the
|
|
507
|
+
* root query object. This property makes `readQuery` capable of reading data
|
|
508
|
+
* from any object in the cache.
|
|
509
|
+
*/
|
|
510
|
+
id?: string;
|
|
511
|
+
/**
|
|
512
|
+
* Whether to return incomplete data rather than null.
|
|
513
|
+
* @defaultValue false
|
|
514
|
+
*/
|
|
515
|
+
returnPartialData?: boolean;
|
|
516
|
+
/**
|
|
517
|
+
* Whether to read from optimistic or non-optimistic cache data.
|
|
518
|
+
* This option should be preferred over the `optimistic` parameter of the
|
|
519
|
+
* `readQuery` method.
|
|
520
|
+
* @defaultValue false
|
|
521
|
+
*/
|
|
522
|
+
optimistic?: boolean;
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
type ReadQueryOptions<TData, TVariables extends OperationVariables> = Base.ReadQueryOptions<TData, TVariables> & VariablesOption<TVariables>;
|
|
526
|
+
namespace DocumentationTypes {
|
|
527
|
+
interface ReadQueryOptions<TData, TVariables extends OperationVariables> extends Base.ReadQueryOptions<TData, TVariables> {
|
|
528
|
+
/**
|
|
529
|
+
* Any variables that the GraphQL query may depend on.
|
|
530
|
+
*/
|
|
531
|
+
variables?: TVariables;
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
namespace Base {
|
|
535
|
+
interface ReadFragmentOptions<TData, TVariables extends OperationVariables> {
|
|
536
|
+
/**
|
|
537
|
+
* The root id to be used. This id should take the same form as the
|
|
538
|
+
* value returned by the `cache.identify` function. If a value with your
|
|
539
|
+
* id does not exist in the store, `null` will be returned.
|
|
540
|
+
*/
|
|
541
|
+
id?: string;
|
|
542
|
+
/**
|
|
543
|
+
* A GraphQL document created using the `gql` template string tag
|
|
544
|
+
* with one or more fragments which will be used to determine
|
|
545
|
+
* the shape of data to read. If you provide more than one fragment in this
|
|
546
|
+
* document then you must also specify `fragmentName` to specify which
|
|
547
|
+
* fragment is the root fragment.
|
|
548
|
+
*/
|
|
549
|
+
fragment: DocumentNode | TypedDocumentNode<TData, TVariables>;
|
|
550
|
+
/**
|
|
551
|
+
* The name of the fragment in your GraphQL document to be used. If you do
|
|
552
|
+
* not provide a `fragmentName` and there is only one fragment in your
|
|
553
|
+
* `fragment` document then that fragment will be used.
|
|
554
|
+
*/
|
|
555
|
+
fragmentName?: string;
|
|
556
|
+
/**
|
|
557
|
+
* Whether to return incomplete data rather than null.
|
|
558
|
+
* @defaultValue false
|
|
559
|
+
*/
|
|
560
|
+
returnPartialData?: boolean;
|
|
561
|
+
/**
|
|
562
|
+
* Whether to read from optimistic or non-optimistic cache data.
|
|
563
|
+
* This option should be preferred over the `optimistic` parameter of the
|
|
564
|
+
* `readFragment` method.
|
|
565
|
+
* @defaultValue false
|
|
566
|
+
*/
|
|
567
|
+
optimistic?: boolean;
|
|
568
|
+
}
|
|
569
|
+
}
|
|
570
|
+
type ReadFragmentOptions<TData, TVariables extends OperationVariables> = Base.ReadFragmentOptions<TData, TVariables> & VariablesOption<TVariables>;
|
|
571
|
+
namespace DocumentationTypes {
|
|
572
|
+
interface WriteQueryOptions<TData, TVariables extends OperationVariables> extends Base.WriteQueryOptions<TData, TVariables> {
|
|
573
|
+
/**
|
|
574
|
+
* Any variables that your GraphQL fragments depend on.
|
|
575
|
+
*/
|
|
576
|
+
variables?: TVariables;
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
namespace Base {
|
|
580
|
+
interface WriteQueryOptions<TData, TVariables extends OperationVariables> {
|
|
581
|
+
/**
|
|
582
|
+
* The GraphQL query shape to be used constructed using the `gql` template
|
|
583
|
+
* string tag. The query will be used to determine the
|
|
584
|
+
* shape of the data to be read.
|
|
585
|
+
*/
|
|
586
|
+
query: DocumentNode | TypedDocumentNode<TData, TVariables>;
|
|
587
|
+
/**
|
|
588
|
+
* The root id to be used. Defaults to "ROOT_QUERY", which is the ID of the
|
|
589
|
+
* root query object. This property makes writeQuery capable of writing data
|
|
590
|
+
* to any object in the cache.
|
|
591
|
+
*/
|
|
592
|
+
id?: string;
|
|
593
|
+
/**
|
|
594
|
+
* The data to write to the store.
|
|
595
|
+
*/
|
|
596
|
+
data: Unmasked<TData>;
|
|
597
|
+
/**
|
|
598
|
+
* Whether to notify query watchers.
|
|
599
|
+
* @defaultValue true
|
|
600
|
+
*/
|
|
601
|
+
broadcast?: boolean;
|
|
602
|
+
/**
|
|
603
|
+
* When true, ignore existing field data rather than merging it with
|
|
604
|
+
* incoming data.
|
|
605
|
+
* @defaultValue false
|
|
606
|
+
*/
|
|
607
|
+
overwrite?: boolean;
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
type WriteQueryOptions<TData, TVariables extends OperationVariables> = Base.WriteQueryOptions<TData, TVariables> & VariablesOption<TVariables>;
|
|
611
|
+
namespace DocumentationTypes {
|
|
612
|
+
interface WriteQueryOptions<TData, TVariables extends OperationVariables> extends Base.WriteQueryOptions<TData, TVariables> {
|
|
613
|
+
/**
|
|
614
|
+
* Any variables that the GraphQL query may depend on.
|
|
615
|
+
*/
|
|
616
|
+
variables?: TVariables;
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
namespace Base {
|
|
620
|
+
interface WriteFragmentOptions<TData, TVariables extends OperationVariables> {
|
|
621
|
+
/**
|
|
622
|
+
* The root id to be used. This id should take the same form as the
|
|
623
|
+
* value returned by the `cache.identify` function. If a value with your
|
|
624
|
+
* id does not exist in the store, `null` will be returned.
|
|
625
|
+
*/
|
|
626
|
+
id?: string;
|
|
627
|
+
/**
|
|
628
|
+
* A GraphQL document created using the `gql` template string tag from
|
|
629
|
+
* `graphql-tag` with one or more fragments which will be used to determine
|
|
630
|
+
* the shape of data to read. If you provide more than one fragment in this
|
|
631
|
+
* document then you must also specify `fragmentName` to specify which
|
|
632
|
+
* fragment is the root fragment.
|
|
633
|
+
*/
|
|
634
|
+
fragment: DocumentNode | TypedDocumentNode<TData, TVariables>;
|
|
635
|
+
/**
|
|
636
|
+
* The name of the fragment in your GraphQL document to be used. If you do
|
|
637
|
+
* not provide a `fragmentName` and there is only one fragment in your
|
|
638
|
+
* `fragment` document then that fragment will be used.
|
|
639
|
+
*/
|
|
640
|
+
fragmentName?: string;
|
|
641
|
+
/**
|
|
642
|
+
* The data to write to the store.
|
|
643
|
+
*/
|
|
644
|
+
data: Unmasked<TData>;
|
|
645
|
+
/**
|
|
646
|
+
* Whether to notify query watchers.
|
|
647
|
+
* @defaultValue true
|
|
648
|
+
*/
|
|
649
|
+
broadcast?: boolean;
|
|
650
|
+
/**
|
|
651
|
+
* When true, ignore existing field data rather than merging it with
|
|
652
|
+
* incoming data.
|
|
653
|
+
* @defaultValue false
|
|
654
|
+
*/
|
|
655
|
+
overwrite?: boolean;
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
type WriteFragmentOptions<TData, TVariables extends OperationVariables> = Base.WriteFragmentOptions<TData, TVariables> & VariablesOption<TVariables>;
|
|
659
|
+
namespace DocumentationTypes {
|
|
660
|
+
interface WriteFragmentOptions<TData, TVariables extends OperationVariables> extends Base.WriteFragmentOptions<TData, TVariables> {
|
|
661
|
+
/**
|
|
662
|
+
* Any variables that your GraphQL fragments depend on.
|
|
663
|
+
*/
|
|
664
|
+
variables?: TVariables;
|
|
665
|
+
}
|
|
666
|
+
}
|
|
104
667
|
}
|
|
105
668
|
/**
|
|
106
669
|
* This is the primary Apollo Client class. It is used to send GraphQL documents (i.e. queries
|
|
@@ -108,7 +671,7 @@ export interface ApolloClientOptions {
|
|
|
108
671
|
* receive results from the server and cache the results in a store. It also delivers updates
|
|
109
672
|
* to GraphQL queries through `Observable` instances.
|
|
110
673
|
*/
|
|
111
|
-
export declare class ApolloClient
|
|
674
|
+
export declare class ApolloClient {
|
|
112
675
|
link: ApolloLink;
|
|
113
676
|
cache: ApolloCache;
|
|
114
677
|
/**
|
|
@@ -126,8 +689,8 @@ export declare class ApolloClient implements DataProxy {
|
|
|
126
689
|
get prioritizeCacheValues(): boolean;
|
|
127
690
|
version: string;
|
|
128
691
|
queryDeduplication: boolean;
|
|
129
|
-
defaultOptions: DefaultOptions;
|
|
130
|
-
readonly devtoolsConfig: DevtoolsOptions;
|
|
692
|
+
defaultOptions: ApolloClient.DefaultOptions;
|
|
693
|
+
readonly devtoolsConfig: ApolloClient.DevtoolsOptions;
|
|
131
694
|
private queryManager;
|
|
132
695
|
private devToolsHookCb?;
|
|
133
696
|
private resetStoreCallbacks;
|
|
@@ -136,29 +699,30 @@ export declare class ApolloClient implements DataProxy {
|
|
|
136
699
|
* Constructs an instance of `ApolloClient`.
|
|
137
700
|
*
|
|
138
701
|
* @example
|
|
702
|
+
*
|
|
139
703
|
* ```js
|
|
140
|
-
* import { ApolloClient, InMemoryCache } from
|
|
704
|
+
* import { ApolloClient, InMemoryCache } from "@apollo/client";
|
|
141
705
|
*
|
|
142
706
|
* const cache = new InMemoryCache();
|
|
143
707
|
*
|
|
144
708
|
* const client = new ApolloClient({
|
|
145
709
|
* // Provide required constructor fields
|
|
146
710
|
* cache: cache,
|
|
147
|
-
* uri:
|
|
711
|
+
* uri: "http://localhost:4000/",
|
|
148
712
|
*
|
|
149
713
|
* // Provide some optional constructor fields
|
|
150
|
-
* name:
|
|
151
|
-
* version:
|
|
714
|
+
* name: "react-web-client",
|
|
715
|
+
* version: "1.3",
|
|
152
716
|
* queryDeduplication: false,
|
|
153
717
|
* defaultOptions: {
|
|
154
718
|
* watchQuery: {
|
|
155
|
-
* fetchPolicy:
|
|
719
|
+
* fetchPolicy: "cache-and-network",
|
|
156
720
|
* },
|
|
157
721
|
* },
|
|
158
722
|
* });
|
|
159
723
|
* ```
|
|
160
724
|
*/
|
|
161
|
-
constructor(options:
|
|
725
|
+
constructor(options: ApolloClient.Options);
|
|
162
726
|
private connectToDevTools;
|
|
163
727
|
/**
|
|
164
728
|
* The `DocumentTransform` used to modify GraphQL documents before a request
|
|
@@ -177,6 +741,7 @@ export declare class ApolloClient implements DataProxy {
|
|
|
177
741
|
* to dispose of this `ApolloClient` instance.
|
|
178
742
|
*
|
|
179
743
|
* This method performs aggressive cleanup to prevent memory leaks:
|
|
744
|
+
*
|
|
180
745
|
* - Unsubscribes all active `ObservableQuery` instances by emitting a `completed` event
|
|
181
746
|
* - Rejects all currently running queries with "QueryManager stopped while query was in flight"
|
|
182
747
|
* - Removes all queryRefs from the suspense cache
|
|
@@ -192,16 +757,16 @@ export declare class ApolloClient implements DataProxy {
|
|
|
192
757
|
*
|
|
193
758
|
* For example, suppose you call watchQuery on a GraphQL query that fetches a person's
|
|
194
759
|
* first and last name and this person has a particular object identifier, provided by
|
|
195
|
-
*
|
|
760
|
+
* `cache.identify`. Later, a different query fetches that same person's
|
|
196
761
|
* first and last name and the first name has now changed. Then, any observers associated
|
|
197
762
|
* with the results of the first query will be updated with a new result object.
|
|
198
763
|
*
|
|
199
|
-
* Note that if the cache does not change, the subscriber will
|
|
764
|
+
* Note that if the cache does not change, the subscriber will _not_ be notified.
|
|
200
765
|
*
|
|
201
766
|
* See [here](https://medium.com/apollo-stack/the-concepts-of-graphql-bc68bd819be3#.3mb0cbcmc) for
|
|
202
767
|
* a description of store reactivity.
|
|
203
768
|
*/
|
|
204
|
-
watchQuery<TData = unknown, TVariables extends OperationVariables = OperationVariables>(options: WatchQueryOptions<
|
|
769
|
+
watchQuery<TData = unknown, TVariables extends OperationVariables = OperationVariables>(options: ApolloClient.WatchQueryOptions<TData, TVariables>): ObservableQuery<TData, TVariables>;
|
|
205
770
|
/**
|
|
206
771
|
* This resolves a single query according to the options specified and
|
|
207
772
|
* returns a `Promise` which is either resolved with the resulting data
|
|
@@ -211,7 +776,7 @@ export declare class ApolloClient implements DataProxy {
|
|
|
211
776
|
* describe how this query should be treated e.g. whether it should hit the
|
|
212
777
|
* server at all or just resolve from the cache, etc.
|
|
213
778
|
*/
|
|
214
|
-
query<TData = unknown, TVariables extends OperationVariables = OperationVariables>(options: QueryOptions<
|
|
779
|
+
query<TData = unknown, TVariables extends OperationVariables = OperationVariables>(options: ApolloClient.QueryOptions<TData, TVariables>): Promise<ApolloClient.QueryResult<MaybeMasked<TData>>>;
|
|
215
780
|
/**
|
|
216
781
|
* This resolves a single mutation according to the options specified and returns a
|
|
217
782
|
* Promise which is either resolved with the resulting data or rejected with an
|
|
@@ -220,22 +785,37 @@ export declare class ApolloClient implements DataProxy {
|
|
|
220
785
|
*
|
|
221
786
|
* It takes options as an object with the following keys and values:
|
|
222
787
|
*/
|
|
223
|
-
mutate<TData = unknown, TVariables extends OperationVariables = OperationVariables, TCache extends ApolloCache = ApolloCache>(options:
|
|
788
|
+
mutate<TData = unknown, TVariables extends OperationVariables = OperationVariables, TCache extends ApolloCache = ApolloCache>(options: ApolloClient.MutateOptions<TData, TVariables, TCache>): Promise<ApolloClient.MutateResult<MaybeMasked<TData>>>;
|
|
224
789
|
/**
|
|
225
790
|
* This subscribes to a graphql subscription according to the options specified and returns an
|
|
226
791
|
* `Observable` which either emits received data or an error.
|
|
227
792
|
*/
|
|
228
|
-
subscribe<TData = unknown, TVariables extends OperationVariables = OperationVariables>(options:
|
|
793
|
+
subscribe<TData = unknown, TVariables extends OperationVariables = OperationVariables>(options: ApolloClient.SubscribeOptions<TData, TVariables>): SubscriptionObservable<ApolloClient.SubscribeResult<MaybeMasked<TData>>>;
|
|
229
794
|
/**
|
|
230
795
|
* Tries to read some data from the store in the shape of the provided
|
|
231
796
|
* GraphQL query without making a network request. This method will start at
|
|
232
|
-
* the root query. To start at a specific id returned by `
|
|
797
|
+
* the root query. To start at a specific id returned by `cache.identify`
|
|
233
798
|
* use `readFragment`.
|
|
234
799
|
*
|
|
235
800
|
* @param optimistic - Set to `true` to allow `readQuery` to return
|
|
236
801
|
* optimistic results. Is `false` by default.
|
|
237
802
|
*/
|
|
238
|
-
readQuery<TData = unknown, TVariables = OperationVariables>(options:
|
|
803
|
+
readQuery<TData = unknown, TVariables extends OperationVariables = OperationVariables>(options: ApolloClient.ReadQueryOptions<TData, TVariables>): Unmasked<TData> | null;
|
|
804
|
+
/**
|
|
805
|
+
* Tries to read some data from the store in the shape of the provided GraphQL query without making a network request. This method will start at the root query. To start at a specific id returned by `cache.identify` use `readFragment`.
|
|
806
|
+
*
|
|
807
|
+
* @param optimistic - Set to `true` to allow `readQuery` to return optimistic results. Is `false` by default.
|
|
808
|
+
*
|
|
809
|
+
*
|
|
810
|
+
* @deprecated Pass the `optimistic` argument as part of the first argument
|
|
811
|
+
* instead of passing it as a separate option.
|
|
812
|
+
*/
|
|
813
|
+
readQuery<TData = unknown, TVariables extends OperationVariables = OperationVariables>(options: ApolloClient.ReadQueryOptions<TData, TVariables>,
|
|
814
|
+
/**
|
|
815
|
+
* @deprecated Pass the `optimistic` argument as part of the first argument
|
|
816
|
+
* instead of passing it as a separate option.
|
|
817
|
+
*/
|
|
818
|
+
optimistic: boolean): Unmasked<TData> | null;
|
|
239
819
|
/**
|
|
240
820
|
* Watches the cache store of the fragment according to the options specified
|
|
241
821
|
* and returns an `Observable`. We can subscribe to this
|
|
@@ -252,7 +832,7 @@ export declare class ApolloClient implements DataProxy {
|
|
|
252
832
|
* the cache to identify the fragment and optionally specify whether to react
|
|
253
833
|
* to optimistic updates.
|
|
254
834
|
*/
|
|
255
|
-
watchFragment<TData = unknown, TVariables extends OperationVariables = OperationVariables>(options: WatchFragmentOptions<TData, TVariables>): Observable<WatchFragmentResult<MaybeMasked<TData>>>;
|
|
835
|
+
watchFragment<TData = unknown, TVariables extends OperationVariables = OperationVariables>(options: ApolloClient.WatchFragmentOptions<TData, TVariables>): Observable<ApolloClient.WatchFragmentResult<MaybeMasked<TData>>>;
|
|
256
836
|
/**
|
|
257
837
|
* Tries to read some data from the store in the shape of the provided
|
|
258
838
|
* GraphQL fragment without making a network request. This method will read a
|
|
@@ -267,13 +847,25 @@ export declare class ApolloClient implements DataProxy {
|
|
|
267
847
|
* @param optimistic - Set to `true` to allow `readFragment` to return
|
|
268
848
|
* optimistic results. Is `false` by default.
|
|
269
849
|
*/
|
|
270
|
-
readFragment<
|
|
850
|
+
readFragment<TData = unknown, TVariables extends OperationVariables = OperationVariables>(options: ApolloClient.ReadFragmentOptions<TData, TVariables>): Unmasked<TData> | null;
|
|
851
|
+
/**
|
|
852
|
+
* Tries to read some data from the store in the shape of the provided GraphQL fragment without making a network request. This method will read a GraphQL fragment from any arbitrary id that is currently cached, unlike `readQuery` which will only read from the root query.
|
|
853
|
+
*
|
|
854
|
+
* You must pass in a GraphQL document with a single fragment or a document with multiple fragments that represent what you are reading. If you pass in a document with multiple fragments then you must also specify a `fragmentName`.
|
|
855
|
+
*
|
|
856
|
+
* @param optimistic - Set to `true` to allow `readFragment` to return optimistic results. Is `false` by default.
|
|
857
|
+
*
|
|
858
|
+
*
|
|
859
|
+
* @deprecated Pass the `optimistic` argument as part of the first argument
|
|
860
|
+
* instead of passing it as a separate option.
|
|
861
|
+
*/
|
|
862
|
+
readFragment<TData = unknown, TVariables extends OperationVariables = OperationVariables>(options: ApolloClient.ReadFragmentOptions<TData, TVariables>, optimistic: boolean): Unmasked<TData> | null;
|
|
271
863
|
/**
|
|
272
864
|
* Writes some data in the shape of the provided GraphQL query directly to
|
|
273
865
|
* the store. This method will start at the root query. To start at a
|
|
274
|
-
* specific id returned by `
|
|
866
|
+
* specific id returned by `cache.identify` then use `writeFragment`.
|
|
275
867
|
*/
|
|
276
|
-
writeQuery<TData = unknown, TVariables = OperationVariables>(options:
|
|
868
|
+
writeQuery<TData = unknown, TVariables extends OperationVariables = OperationVariables>(options: ApolloClient.WriteQueryOptions<TData, TVariables>): Reference | undefined;
|
|
277
869
|
/**
|
|
278
870
|
* Writes some data in the shape of the provided GraphQL fragment directly to
|
|
279
871
|
* the store. This method will write to a GraphQL fragment from any arbitrary
|
|
@@ -285,7 +877,7 @@ export declare class ApolloClient implements DataProxy {
|
|
|
285
877
|
* in a document with multiple fragments then you must also specify a
|
|
286
878
|
* `fragmentName`.
|
|
287
879
|
*/
|
|
288
|
-
writeFragment<TData = unknown, TVariables = OperationVariables>(options:
|
|
880
|
+
writeFragment<TData = unknown, TVariables extends OperationVariables = OperationVariables>(options: ApolloClient.WriteFragmentOptions<TData, TVariables>): Reference | undefined;
|
|
289
881
|
__actionHookForDevTools(cb: () => any): void;
|
|
290
882
|
__requestRaw(payload: GraphQLRequest): Observable<FetchResult<unknown>>;
|
|
291
883
|
/**
|
|
@@ -298,13 +890,13 @@ export declare class ApolloClient implements DataProxy {
|
|
|
298
890
|
* user session, and you now want to make sure that any references to data you
|
|
299
891
|
* might have fetched while the user session was active is gone.
|
|
300
892
|
*
|
|
301
|
-
* It is important to remember that `resetStore()`
|
|
893
|
+
* It is important to remember that `resetStore()` _will_ refetch any active
|
|
302
894
|
* queries. This means that any components that might be mounted will execute
|
|
303
895
|
* their queries again using your network interface. If you do not want to
|
|
304
896
|
* re-execute any queries then you should make sure to stop watching any
|
|
305
897
|
* active queries.
|
|
306
898
|
*/
|
|
307
|
-
resetStore(): Promise<QueryResult<any>[] | null>;
|
|
899
|
+
resetStore(): Promise<ApolloClient.QueryResult<any>[] | null>;
|
|
308
900
|
/**
|
|
309
901
|
* Remove all data from the store. Unlike `resetStore`, `clearStore` will
|
|
310
902
|
* not refetch any active queries.
|
|
@@ -327,7 +919,7 @@ export declare class ApolloClient implements DataProxy {
|
|
|
327
919
|
*
|
|
328
920
|
* `reFetchObservableQueries()` is useful if you want to bring the client back to proper state in case of a network outage
|
|
329
921
|
*
|
|
330
|
-
* It is important to remember that `reFetchObservableQueries()`
|
|
922
|
+
* It is important to remember that `reFetchObservableQueries()` _will_ refetch any active
|
|
331
923
|
* queries. This means that any components that might be mounted will execute
|
|
332
924
|
* their queries again using your network interface. If you do not want to
|
|
333
925
|
* re-execute any queries then you should make sure to stop watching any
|
|
@@ -338,13 +930,13 @@ export declare class ApolloClient implements DataProxy {
|
|
|
338
930
|
*
|
|
339
931
|
* @deprecated Please use `refetchObservableQueries` instead.
|
|
340
932
|
*/
|
|
341
|
-
reFetchObservableQueries: (includeStandby?: boolean) => Promise<QueryResult<any>[]>;
|
|
933
|
+
reFetchObservableQueries: (includeStandby?: boolean) => Promise<ApolloClient.QueryResult<any>[]>;
|
|
342
934
|
/**
|
|
343
935
|
* Refetches all of your active queries.
|
|
344
936
|
*
|
|
345
937
|
* `refetchObservableQueries()` is useful if you want to bring the client back to proper state in case of a network outage
|
|
346
938
|
*
|
|
347
|
-
* It is important to remember that `refetchObservableQueries()`
|
|
939
|
+
* It is important to remember that `refetchObservableQueries()` _will_ refetch any active
|
|
348
940
|
* queries. This means that any components that might be mounted will execute
|
|
349
941
|
* their queries again using your network interface. If you do not want to
|
|
350
942
|
* re-execute any queries then you should make sure to stop watching any
|
|
@@ -353,19 +945,19 @@ export declare class ApolloClient implements DataProxy {
|
|
|
353
945
|
*
|
|
354
946
|
* Note: `cache-only` queries are not refetched by this function.
|
|
355
947
|
*/
|
|
356
|
-
refetchObservableQueries(includeStandby?: boolean): Promise<QueryResult<any>[]>;
|
|
948
|
+
refetchObservableQueries(includeStandby?: boolean): Promise<ApolloClient.QueryResult<any>[]>;
|
|
357
949
|
/**
|
|
358
950
|
* Refetches specified active queries. Similar to "refetchObservableQueries()" but with a specific list of queries.
|
|
359
951
|
*
|
|
360
952
|
* `refetchQueries()` is useful for use cases to imperatively refresh a selection of queries.
|
|
361
953
|
*
|
|
362
|
-
* It is important to remember that `refetchQueries()`
|
|
954
|
+
* It is important to remember that `refetchQueries()` _will_ refetch specified active
|
|
363
955
|
* queries. This means that any components that might be mounted will execute
|
|
364
956
|
* their queries again using your network interface. If you do not want to
|
|
365
957
|
* re-execute any queries then you should make sure to stop watching any
|
|
366
958
|
* active queries.
|
|
367
959
|
*/
|
|
368
|
-
refetchQueries<TCache extends ApolloCache = ApolloCache, TResult = Promise<QueryResult<any>>>(options: RefetchQueriesOptions<TCache, TResult>): RefetchQueriesResult<TResult>;
|
|
960
|
+
refetchQueries<TCache extends ApolloCache = ApolloCache, TResult = Promise<ApolloClient.QueryResult<any>>>(options: ApolloClient.RefetchQueriesOptions<TCache, TResult>): ApolloClient.RefetchQueriesResult<TResult>;
|
|
369
961
|
/**
|
|
370
962
|
* Get all currently active `ObservableQuery` objects, in a `Set`.
|
|
371
963
|
*
|
|
@@ -407,77 +999,79 @@ export declare class ApolloClient implements DataProxy {
|
|
|
407
999
|
* For more details, see [Memory Management](https://www.apollographql.com/docs/react/caching/memory-management/#measuring-cache-usage)
|
|
408
1000
|
*
|
|
409
1001
|
* @example
|
|
1002
|
+
*
|
|
410
1003
|
* ```ts
|
|
411
|
-
* console.log(client.getMemoryInternals())
|
|
1004
|
+
* console.log(client.getMemoryInternals());
|
|
412
1005
|
* ```
|
|
1006
|
+
*
|
|
413
1007
|
* Logs output in the following JSON format:
|
|
414
1008
|
* @example
|
|
1009
|
+
*
|
|
415
1010
|
* ```json
|
|
416
|
-
*{
|
|
417
|
-
*
|
|
418
|
-
*
|
|
419
|
-
*
|
|
420
|
-
*
|
|
421
|
-
*
|
|
422
|
-
*
|
|
423
|
-
*
|
|
424
|
-
*
|
|
425
|
-
*
|
|
426
|
-
*
|
|
427
|
-
*
|
|
428
|
-
*
|
|
429
|
-
*
|
|
430
|
-
*
|
|
431
|
-
*
|
|
432
|
-
*
|
|
433
|
-
*
|
|
434
|
-
*
|
|
435
|
-
*
|
|
436
|
-
*
|
|
437
|
-
*
|
|
438
|
-
*
|
|
439
|
-
*
|
|
440
|
-
*
|
|
441
|
-
*
|
|
442
|
-
*
|
|
443
|
-
*
|
|
444
|
-
*
|
|
445
|
-
*
|
|
446
|
-
*
|
|
447
|
-
*
|
|
448
|
-
*
|
|
449
|
-
*
|
|
450
|
-
*
|
|
451
|
-
*
|
|
452
|
-
*
|
|
453
|
-
*
|
|
454
|
-
*
|
|
455
|
-
*
|
|
456
|
-
*
|
|
457
|
-
*
|
|
458
|
-
*
|
|
459
|
-
*
|
|
460
|
-
*
|
|
461
|
-
*
|
|
462
|
-
*
|
|
463
|
-
*
|
|
464
|
-
*
|
|
465
|
-
*
|
|
466
|
-
*
|
|
467
|
-
*
|
|
468
|
-
*
|
|
469
|
-
*
|
|
470
|
-
*
|
|
471
|
-
*
|
|
472
|
-
*
|
|
473
|
-
*
|
|
474
|
-
*
|
|
475
|
-
*
|
|
476
|
-
*
|
|
1011
|
+
* {
|
|
1012
|
+
* "limits": {
|
|
1013
|
+
* "canonicalStringify": 1000,
|
|
1014
|
+
* "print": 2000,
|
|
1015
|
+
* "documentTransform.cache": 2000,
|
|
1016
|
+
* "queryManager.getDocumentInfo": 2000,
|
|
1017
|
+
* "PersistedQueryLink.persistedQueryHashes": 2000,
|
|
1018
|
+
* "fragmentRegistry.transform": 2000,
|
|
1019
|
+
* "fragmentRegistry.lookup": 1000,
|
|
1020
|
+
* "fragmentRegistry.findFragmentSpreads": 4000,
|
|
1021
|
+
* "cache.fragmentQueryDocuments": 1000,
|
|
1022
|
+
* "removeTypenameFromVariables.getVariableDefinitions": 2000,
|
|
1023
|
+
* "inMemoryCache.maybeBroadcastWatch": 5000,
|
|
1024
|
+
* "inMemoryCache.executeSelectionSet": 10000,
|
|
1025
|
+
* "inMemoryCache.executeSubSelectedArray": 5000
|
|
1026
|
+
* },
|
|
1027
|
+
* "sizes": {
|
|
1028
|
+
* "canonicalStringify": 4,
|
|
1029
|
+
* "print": 14,
|
|
1030
|
+
* "addTypenameDocumentTransform": [
|
|
1031
|
+
* {
|
|
1032
|
+
* "cache": 14
|
|
1033
|
+
* }
|
|
1034
|
+
* ],
|
|
1035
|
+
* "queryManager": {
|
|
1036
|
+
* "getDocumentInfo": 14,
|
|
1037
|
+
* "documentTransforms": [
|
|
1038
|
+
* {
|
|
1039
|
+
* "cache": 14
|
|
1040
|
+
* },
|
|
1041
|
+
* {
|
|
1042
|
+
* "cache": 14
|
|
1043
|
+
* }
|
|
1044
|
+
* ]
|
|
1045
|
+
* },
|
|
1046
|
+
* "fragmentRegistry": {
|
|
1047
|
+
* "findFragmentSpreads": 34,
|
|
1048
|
+
* "lookup": 20,
|
|
1049
|
+
* "transform": 14
|
|
1050
|
+
* },
|
|
1051
|
+
* "cache": {
|
|
1052
|
+
* "fragmentQueryDocuments": 22
|
|
1053
|
+
* },
|
|
1054
|
+
* "inMemoryCache": {
|
|
1055
|
+
* "executeSelectionSet": 4345,
|
|
1056
|
+
* "executeSubSelectedArray": 1206,
|
|
1057
|
+
* "maybeBroadcastWatch": 32
|
|
1058
|
+
* },
|
|
1059
|
+
* "links": [
|
|
1060
|
+
* {
|
|
1061
|
+
* "PersistedQueryLink": {
|
|
1062
|
+
* "persistedQueryHashes": 14
|
|
1063
|
+
* }
|
|
1064
|
+
* },
|
|
1065
|
+
* {
|
|
1066
|
+
* "removeTypenameFromVariables": {
|
|
1067
|
+
* "getVariableDefinitions": 14
|
|
1068
|
+
* }
|
|
1069
|
+
* }
|
|
1070
|
+
* ]
|
|
1071
|
+
* }
|
|
477
1072
|
* }
|
|
478
|
-
|
|
1073
|
+
* ```
|
|
479
1074
|
*/
|
|
480
1075
|
getMemoryInternals?: typeof getApolloClientMemoryInternals;
|
|
481
1076
|
}
|
|
482
|
-
export {};
|
|
483
1077
|
//# sourceMappingURL=ApolloClient.d.cts.map
|