@apollo/client 4.0.0-rc.6 → 4.0.0-rc.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +159 -0
- package/__cjs/cache/core/cache.cjs +12 -7
- package/__cjs/cache/core/cache.cjs.map +1 -1
- package/__cjs/cache/core/cache.d.cts +12 -7
- package/__cjs/core/ApolloClient.cjs +2 -2
- package/__cjs/core/ApolloClient.cjs.map +1 -1
- package/__cjs/core/ApolloClient.d.cts +80 -98
- package/__cjs/core/ObservableQuery.d.cts +41 -74
- package/__cjs/core/QueryInfo.cjs.map +1 -1
- package/__cjs/core/QueryInfo.d.cts +3 -3
- package/__cjs/core/QueryManager.cjs +0 -2
- package/__cjs/core/QueryManager.cjs.map +1 -1
- package/__cjs/core/QueryManager.d.cts +3 -3
- package/__cjs/core/index.cjs +1 -2
- package/__cjs/core/index.cjs.map +1 -1
- package/__cjs/core/index.d.cts +2 -3
- package/__cjs/core/types.d.cts +40 -28
- package/__cjs/errors/CombinedGraphQLErrors.cjs +22 -17
- package/__cjs/errors/CombinedGraphQLErrors.cjs.map +1 -1
- package/__cjs/errors/CombinedGraphQLErrors.d.cts +39 -20
- package/__cjs/errors/CombinedProtocolErrors.cjs +12 -6
- package/__cjs/errors/CombinedProtocolErrors.cjs.map +1 -1
- package/__cjs/errors/CombinedProtocolErrors.d.cts +12 -6
- package/__cjs/errors/ServerError.cjs +2 -1
- package/__cjs/errors/ServerError.cjs.map +1 -1
- package/__cjs/errors/ServerError.d.cts +2 -1
- package/__cjs/errors/ServerParseError.cjs +2 -1
- package/__cjs/errors/ServerParseError.cjs.map +1 -1
- package/__cjs/errors/ServerParseError.d.cts +2 -1
- package/__cjs/incremental/handlers/defer20220824.cjs.map +1 -1
- package/__cjs/incremental/handlers/defer20220824.d.cts +4 -4
- package/__cjs/incremental/handlers/notImplemented.cjs.map +1 -1
- package/__cjs/incremental/handlers/notImplemented.d.cts +2 -2
- package/__cjs/incremental/types.d.cts +4 -4
- package/__cjs/invariantErrorCodes.cjs +15 -11
- package/__cjs/link/batch/batchLink.cjs +4 -12
- package/__cjs/link/batch/batchLink.cjs.map +1 -1
- package/__cjs/link/batch/batchLink.d.cts +36 -28
- package/__cjs/link/batch/batching.cjs +1 -1
- package/__cjs/link/batch/batching.cjs.map +1 -1
- package/__cjs/link/batch/batching.d.cts +8 -8
- package/__cjs/link/batch/index.cjs +1 -2
- package/__cjs/link/batch/index.cjs.map +1 -1
- package/__cjs/link/batch/index.d.cts +1 -2
- package/__cjs/link/batch-http/batchHttpLink.cjs +29 -6
- package/__cjs/link/batch-http/batchHttpLink.cjs.map +1 -1
- package/__cjs/link/batch-http/batchHttpLink.d.cts +45 -6
- package/__cjs/link/client-awareness/ClientAwarenessLink.cjs +33 -0
- package/__cjs/link/client-awareness/ClientAwarenessLink.cjs.map +1 -1
- package/__cjs/link/client-awareness/ClientAwarenessLink.d.cts +35 -2
- package/__cjs/link/context/index.cjs.map +1 -1
- package/__cjs/link/context/index.d.cts +3 -4
- package/__cjs/link/core/ApolloLink.cjs +226 -54
- package/__cjs/link/core/ApolloLink.cjs.map +1 -1
- package/__cjs/link/core/ApolloLink.d.cts +355 -9
- package/__cjs/link/core/concat.cjs +4 -0
- package/__cjs/link/core/concat.cjs.map +1 -1
- package/__cjs/link/core/concat.d.cts +4 -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 +4 -0
- package/__cjs/link/core/empty.cjs.map +1 -1
- package/__cjs/link/core/empty.d.cts +4 -0
- package/__cjs/link/core/from.cjs +4 -0
- package/__cjs/link/core/from.cjs.map +1 -1
- package/__cjs/link/core/from.d.cts +4 -0
- package/__cjs/link/core/split.cjs +4 -0
- package/__cjs/link/core/split.cjs.map +1 -1
- package/__cjs/link/core/split.d.cts +4 -0
- package/__cjs/link/core/types.d.cts +2 -33
- package/__cjs/link/error/index.cjs +44 -0
- package/__cjs/link/error/index.cjs.map +1 -1
- package/__cjs/link/error/index.d.cts +68 -9
- package/__cjs/link/http/BaseHttpLink.cjs +3 -4
- package/__cjs/link/http/BaseHttpLink.cjs.map +1 -1
- package/__cjs/link/http/HttpLink.cjs +26 -1
- package/__cjs/link/http/HttpLink.cjs.map +1 -1
- package/__cjs/link/http/HttpLink.d.cts +191 -89
- package/__cjs/link/http/index.cjs +1 -3
- package/__cjs/link/http/index.cjs.map +1 -1
- package/__cjs/link/http/index.d.cts +0 -2
- package/__cjs/link/http/parseAndCheckHttpResponse.cjs +40 -25
- package/__cjs/link/http/parseAndCheckHttpResponse.cjs.map +1 -1
- package/__cjs/link/http/parseAndCheckHttpResponse.d.cts +2 -2
- package/__cjs/link/http/rewriteURIForGET.cjs +2 -3
- package/__cjs/link/http/rewriteURIForGET.cjs.map +1 -1
- package/__cjs/link/http/selectHttpOptionsAndBody.cjs.map +1 -1
- package/__cjs/link/http/selectHttpOptionsAndBody.d.cts +3 -3
- package/__cjs/link/http/selectURI.cjs.map +1 -1
- package/__cjs/link/http/selectURI.d.cts +2 -2
- package/__cjs/link/index.cjs.map +1 -1
- package/__cjs/link/index.d.cts +2 -1
- package/__cjs/link/persisted-queries/index.cjs.map +1 -1
- package/__cjs/link/persisted-queries/index.d.cts +23 -25
- package/__cjs/link/remove-typename/index.cjs.map +1 -1
- package/__cjs/link/remove-typename/index.d.cts +0 -1
- package/__cjs/link/remove-typename/removeTypenameFromVariables.cjs.map +1 -1
- package/__cjs/link/remove-typename/removeTypenameFromVariables.d.cts +9 -8
- package/__cjs/link/retry/delayFunction.cjs.map +1 -1
- package/__cjs/link/retry/delayFunction.d.cts +2 -39
- package/__cjs/link/retry/retryFunction.cjs.map +1 -1
- package/__cjs/link/retry/retryFunction.d.cts +2 -29
- package/__cjs/link/retry/retryLink.cjs +12 -9
- package/__cjs/link/retry/retryLink.cjs.map +1 -1
- package/__cjs/link/retry/retryLink.d.cts +57 -6
- package/__cjs/link/schema/index.cjs.map +1 -1
- package/__cjs/link/schema/index.d.cts +3 -4
- package/__cjs/link/subscriptions/index.cjs +23 -0
- package/__cjs/link/subscriptions/index.cjs.map +1 -1
- package/__cjs/link/subscriptions/index.d.cts +24 -2
- package/__cjs/link/utils/createOperation.cjs +12 -4
- package/__cjs/link/utils/createOperation.cjs.map +1 -1
- package/__cjs/link/utils/createOperation.d.cts +2 -2
- package/__cjs/link/utils/index.cjs +1 -5
- package/__cjs/link/utils/index.cjs.map +1 -1
- package/__cjs/link/utils/index.d.cts +0 -2
- package/__cjs/link/ws/index.cjs +17 -1
- package/__cjs/link/ws/index.cjs.map +1 -1
- package/__cjs/link/ws/index.d.cts +8 -2
- package/__cjs/react/hooks/useBackgroundQuery.cjs.map +1 -1
- package/__cjs/react/hooks/useBackgroundQuery.d.cts +125 -93
- package/__cjs/react/hooks/useFragment.cjs.map +1 -1
- package/__cjs/react/hooks/useFragment.d.cts +2 -2
- package/__cjs/react/hooks/useLazyQuery.cjs.map +1 -1
- package/__cjs/react/hooks/useLazyQuery.d.cts +70 -108
- package/__cjs/react/hooks/useLoadableQuery.cjs.map +1 -1
- package/__cjs/react/hooks/useLoadableQuery.d.cts +52 -61
- package/__cjs/react/hooks/useMutation.cjs.map +1 -1
- package/__cjs/react/hooks/useMutation.d.cts +36 -54
- package/__cjs/react/hooks/useQuery.cjs.map +1 -1
- package/__cjs/react/hooks/useQuery.d.cts +64 -105
- package/__cjs/react/hooks/useQueryRefHandlers.cjs.map +1 -1
- package/__cjs/react/hooks/useQueryRefHandlers.d.cts +17 -8
- package/__cjs/react/hooks/useReadQuery.cjs.map +1 -1
- package/__cjs/react/hooks/useReadQuery.d.cts +6 -9
- package/__cjs/react/hooks/useSubscription.cjs.map +1 -1
- package/__cjs/react/hooks/useSubscription.d.cts +32 -24
- package/__cjs/react/hooks/useSuspenseFragment.cjs.map +1 -1
- package/__cjs/react/hooks/useSuspenseQuery.cjs.map +1 -1
- package/__cjs/react/hooks/useSuspenseQuery.d.cts +75 -94
- package/__cjs/react/internal/cache/QueryReference.cjs.map +1 -1
- package/__cjs/react/internal/cache/QueryReference.d.cts +3 -1
- package/__cjs/react/query-preloader/createQueryPreloader.cjs.map +1 -1
- package/__cjs/react/query-preloader/createQueryPreloader.d.cts +29 -20
- package/__cjs/react/types/types.documentation.d.cts +5 -5
- package/__cjs/testing/core/mocking/mockLink.cjs.map +1 -1
- package/__cjs/testing/core/mocking/mockLink.d.cts +5 -6
- package/__cjs/testing/core/mocking/mockSubscriptionLink.cjs.map +1 -1
- package/__cjs/testing/core/mocking/mockSubscriptionLink.d.cts +3 -4
- package/__cjs/utilities/internal/types/DocumentationTypes.d.cts +20 -28
- package/__cjs/utilities/internal/types/VariablesOption.d.cts +2 -6
- package/__cjs/utilities/subscriptions/relay/index.cjs +1 -2
- package/__cjs/utilities/subscriptions/relay/index.cjs.map +1 -1
- package/__cjs/version.cjs +1 -1
- package/cache/core/cache.d.ts +12 -7
- package/cache/core/cache.js +12 -7
- package/cache/core/cache.js.map +1 -1
- package/core/ApolloClient.d.ts +80 -98
- package/core/ApolloClient.js +2 -2
- package/core/ApolloClient.js.map +1 -1
- package/core/ObservableQuery.d.ts +41 -74
- package/core/QueryInfo.d.ts +3 -3
- package/core/QueryInfo.js.map +1 -1
- package/core/QueryManager.d.ts +3 -3
- package/core/QueryManager.js +0 -2
- package/core/QueryManager.js.map +1 -1
- package/core/index.d.ts +2 -3
- package/core/index.js +1 -1
- package/core/index.js.map +1 -1
- package/core/types.d.ts +40 -28
- package/errors/CombinedGraphQLErrors.d.ts +39 -20
- package/errors/CombinedGraphQLErrors.js +22 -17
- package/errors/CombinedGraphQLErrors.js.map +1 -1
- package/errors/CombinedProtocolErrors.d.ts +12 -6
- package/errors/CombinedProtocolErrors.js +12 -6
- package/errors/CombinedProtocolErrors.js.map +1 -1
- package/errors/ServerError.d.ts +2 -1
- package/errors/ServerError.js +2 -1
- package/errors/ServerError.js.map +1 -1
- package/errors/ServerParseError.d.ts +2 -1
- package/errors/ServerParseError.js +2 -1
- package/errors/ServerParseError.js.map +1 -1
- package/incremental/handlers/defer20220824.d.ts +4 -4
- package/incremental/handlers/defer20220824.js.map +1 -1
- package/incremental/handlers/notImplemented.d.ts +2 -2
- package/incremental/handlers/notImplemented.js.map +1 -1
- package/incremental/types.d.ts +4 -4
- package/incremental/types.js.map +1 -1
- package/invariantErrorCodes.js +15 -11
- package/link/batch/batchLink.d.ts +37 -29
- package/link/batch/batchLink.js +3 -10
- package/link/batch/batchLink.js.map +1 -1
- package/link/batch/batching.d.ts +8 -8
- package/link/batch/batching.js +2 -2
- package/link/batch/batching.js.map +1 -1
- package/link/batch/index.d.ts +1 -2
- package/link/batch/index.js +1 -1
- package/link/batch/index.js.map +1 -1
- package/link/batch-http/batchHttpLink.d.ts +46 -7
- package/link/batch-http/batchHttpLink.js +30 -7
- package/link/batch-http/batchHttpLink.js.map +1 -1
- package/link/client-awareness/ClientAwarenessLink.d.ts +35 -2
- package/link/client-awareness/ClientAwarenessLink.js +33 -0
- package/link/client-awareness/ClientAwarenessLink.js.map +1 -1
- package/link/context/index.d.ts +3 -4
- package/link/context/index.js.map +1 -1
- package/link/core/ApolloLink.d.ts +355 -9
- package/link/core/ApolloLink.js +227 -56
- package/link/core/ApolloLink.js.map +1 -1
- package/link/core/concat.d.ts +4 -0
- package/link/core/concat.js +4 -0
- package/link/core/concat.js.map +1 -1
- 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 +4 -0
- package/link/core/empty.js +4 -0
- package/link/core/empty.js.map +1 -1
- package/link/core/from.d.ts +4 -0
- package/link/core/from.js +4 -0
- package/link/core/from.js.map +1 -1
- package/link/core/split.d.ts +4 -0
- package/link/core/split.js +4 -0
- package/link/core/split.js.map +1 -1
- package/link/core/types.d.ts +2 -33
- package/link/core/types.js.map +1 -1
- package/link/error/index.d.ts +69 -10
- package/link/error/index.js +44 -0
- package/link/error/index.js.map +1 -1
- package/link/http/BaseHttpLink.js +3 -4
- package/link/http/BaseHttpLink.js.map +1 -1
- package/link/http/HttpLink.d.ts +192 -90
- package/link/http/HttpLink.js +26 -1
- package/link/http/HttpLink.js.map +1 -1
- package/link/http/index.d.ts +0 -2
- package/link/http/index.js +0 -1
- package/link/http/index.js.map +1 -1
- package/link/http/parseAndCheckHttpResponse.d.ts +2 -2
- package/link/http/parseAndCheckHttpResponse.js +40 -25
- package/link/http/parseAndCheckHttpResponse.js.map +1 -1
- package/link/http/rewriteURIForGET.js +2 -3
- package/link/http/rewriteURIForGET.js.map +1 -1
- package/link/http/selectHttpOptionsAndBody.d.ts +3 -3
- package/link/http/selectHttpOptionsAndBody.js.map +1 -1
- package/link/http/selectURI.d.ts +2 -2
- package/link/http/selectURI.js.map +1 -1
- package/link/index.d.ts +2 -1
- package/link/index.js.map +1 -1
- package/link/persisted-queries/index.d.ts +23 -25
- package/link/persisted-queries/index.js.map +1 -1
- package/link/remove-typename/index.d.ts +0 -1
- package/link/remove-typename/index.js.map +1 -1
- package/link/remove-typename/removeTypenameFromVariables.d.ts +9 -8
- package/link/remove-typename/removeTypenameFromVariables.js.map +1 -1
- package/link/retry/delayFunction.d.ts +2 -39
- package/link/retry/delayFunction.js.map +1 -1
- package/link/retry/retryFunction.d.ts +2 -29
- package/link/retry/retryFunction.js.map +1 -1
- package/link/retry/retryLink.d.ts +57 -6
- package/link/retry/retryLink.js +13 -10
- package/link/retry/retryLink.js.map +1 -1
- package/link/schema/index.d.ts +3 -4
- package/link/schema/index.js.map +1 -1
- package/link/subscriptions/index.d.ts +24 -2
- package/link/subscriptions/index.js +23 -0
- package/link/subscriptions/index.js.map +1 -1
- package/link/utils/createOperation.d.ts +2 -2
- package/link/utils/createOperation.js +12 -4
- package/link/utils/createOperation.js.map +1 -1
- package/link/utils/index.d.ts +0 -2
- package/link/utils/index.js +0 -2
- package/link/utils/index.js.map +1 -1
- package/link/ws/index.d.ts +8 -2
- package/link/ws/index.js +13 -1
- package/link/ws/index.js.map +1 -1
- package/package.json +1 -1
- package/react/hooks/useBackgroundQuery.d.ts +125 -93
- package/react/hooks/useBackgroundQuery.js.map +1 -1
- package/react/hooks/useFragment.d.ts +2 -2
- package/react/hooks/useFragment.js.map +1 -1
- package/react/hooks/useLazyQuery.d.ts +70 -108
- package/react/hooks/useLazyQuery.js.map +1 -1
- package/react/hooks/useLoadableQuery.d.ts +52 -61
- package/react/hooks/useLoadableQuery.js.map +1 -1
- package/react/hooks/useMutation.d.ts +36 -54
- package/react/hooks/useMutation.js.map +1 -1
- package/react/hooks/useQuery.d.ts +64 -105
- package/react/hooks/useQuery.js.map +1 -1
- package/react/hooks/useQueryRefHandlers.d.ts +17 -8
- package/react/hooks/useQueryRefHandlers.js.map +1 -1
- package/react/hooks/useReadQuery.d.ts +6 -9
- package/react/hooks/useReadQuery.js.map +1 -1
- package/react/hooks/useSubscription.d.ts +32 -24
- package/react/hooks/useSubscription.js.map +1 -1
- package/react/hooks/useSuspenseFragment.js.map +1 -1
- package/react/hooks/useSuspenseQuery.d.ts +75 -94
- package/react/hooks/useSuspenseQuery.js.map +1 -1
- package/react/hooks-compiled/useBackgroundQuery.d.ts +125 -93
- package/react/hooks-compiled/useBackgroundQuery.js.map +1 -1
- package/react/hooks-compiled/useFragment.d.ts +2 -2
- package/react/hooks-compiled/useFragment.js.map +1 -1
- package/react/hooks-compiled/useLazyQuery.d.ts +70 -108
- package/react/hooks-compiled/useLazyQuery.js.map +1 -1
- package/react/hooks-compiled/useLoadableQuery.d.ts +52 -61
- package/react/hooks-compiled/useLoadableQuery.js.map +1 -1
- package/react/hooks-compiled/useMutation.d.ts +36 -54
- package/react/hooks-compiled/useMutation.js.map +1 -1
- package/react/hooks-compiled/useQuery.d.ts +64 -105
- package/react/hooks-compiled/useQuery.js.map +1 -1
- package/react/hooks-compiled/useQueryRefHandlers.d.ts +17 -8
- package/react/hooks-compiled/useQueryRefHandlers.js.map +1 -1
- package/react/hooks-compiled/useReadQuery.d.ts +6 -9
- package/react/hooks-compiled/useReadQuery.js.map +1 -1
- package/react/hooks-compiled/useSubscription.d.ts +32 -24
- package/react/hooks-compiled/useSubscription.js.map +1 -1
- package/react/hooks-compiled/useSuspenseFragment.js.map +1 -1
- package/react/hooks-compiled/useSuspenseQuery.d.ts +75 -94
- package/react/hooks-compiled/useSuspenseQuery.js.map +1 -1
- package/react/internal/cache/QueryReference.d.ts +3 -1
- package/react/internal/cache/QueryReference.js.map +1 -1
- package/react/query-preloader/createQueryPreloader.d.ts +29 -20
- package/react/query-preloader/createQueryPreloader.js.map +1 -1
- package/react/types/types.documentation.d.ts +5 -5
- package/testing/core/mocking/mockLink.d.ts +5 -6
- package/testing/core/mocking/mockLink.js.map +1 -1
- package/testing/core/mocking/mockSubscriptionLink.d.ts +3 -4
- package/testing/core/mocking/mockSubscriptionLink.js.map +1 -1
- package/utilities/internal/types/DocumentationTypes.d.ts +20 -28
- package/utilities/internal/types/VariablesOption.d.ts +2 -6
- package/utilities/subscriptions/relay/index.js +1 -2
- package/utilities/subscriptions/relay/index.js.map +1 -1
- package/version.js +1 -1
- package/__cjs/link/http/serializeFetchParameter.cjs +0 -18
- package/__cjs/link/http/serializeFetchParameter.cjs.map +0 -1
- package/__cjs/link/http/serializeFetchParameter.d.cts +0 -6
- package/__cjs/link/utils/transformOperation.cjs +0 -22
- package/__cjs/link/utils/transformOperation.cjs.map +0 -1
- package/__cjs/link/utils/transformOperation.d.cts +0 -3
- package/__cjs/link/utils/validateOperation.cjs +0 -21
- package/__cjs/link/utils/validateOperation.cjs.map +0 -1
- package/__cjs/link/utils/validateOperation.d.cts +0 -3
- package/link/http/serializeFetchParameter.d.ts +0 -6
- package/link/http/serializeFetchParameter.js +0 -14
- package/link/http/serializeFetchParameter.js.map +0 -1
- package/link/utils/transformOperation.d.ts +0 -3
- package/link/utils/transformOperation.js +0 -19
- package/link/utils/transformOperation.js.map +0 -1
- package/link/utils/validateOperation.d.ts +0 -3
- package/link/utils/validateOperation.js +0 -18
- package/link/utils/validateOperation.js.map +0 -1
|
@@ -2,7 +2,7 @@ import type { DocumentNode } from "graphql";
|
|
|
2
2
|
import type { Observable } from "rxjs";
|
|
3
3
|
import type { ApolloCache, IgnoreModifier, Reference } from "@apollo/client/cache";
|
|
4
4
|
import type { Incremental } from "@apollo/client/incremental";
|
|
5
|
-
import type { ApolloLink
|
|
5
|
+
import type { ApolloLink } 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";
|
|
@@ -62,11 +62,11 @@ export declare namespace ApolloClient {
|
|
|
62
62
|
assumeImmutableResults?: boolean;
|
|
63
63
|
localState?: LocalState;
|
|
64
64
|
/**
|
|
65
|
-
*
|
|
65
|
+
*
|
|
66
66
|
*/
|
|
67
67
|
clientAwareness?: ClientAwarenessLink.ClientAwarenessOptions;
|
|
68
68
|
/**
|
|
69
|
-
*
|
|
69
|
+
*
|
|
70
70
|
*/
|
|
71
71
|
enhancedClientAwareness?: ClientAwarenessLink.EnhancedClientAwarenessOptions;
|
|
72
72
|
documentTransform?: DocumentTransform;
|
|
@@ -104,19 +104,24 @@ export declare namespace ApolloClient {
|
|
|
104
104
|
}
|
|
105
105
|
type MutateOptions<TData = unknown, TVariables extends OperationVariables = OperationVariables, TCache extends ApolloCache = ApolloCache> = {
|
|
106
106
|
/**
|
|
107
|
-
* By providing either an object or a callback function that, when invoked after
|
|
107
|
+
* By providing either an object or a callback function that, when invoked after
|
|
108
|
+
* a mutation, allows you to return optimistic data and optionally skip updates
|
|
109
|
+
* via the `IGNORE` sentinel object, Apollo Client caches this temporary
|
|
110
|
+
* (and potentially incorrect) response until the mutation completes, enabling
|
|
111
|
+
* more responsive UI updates.
|
|
108
112
|
*
|
|
109
113
|
* For more information, see [Optimistic mutation results](https://www.apollographql.com/docs/react/performance/optimistic-ui/).
|
|
110
114
|
*
|
|
111
|
-
* @docGroup
|
|
112
|
-
*
|
|
113
|
-
* 3. Caching options
|
|
115
|
+
* @docGroup 3. Caching options
|
|
114
116
|
*/
|
|
115
117
|
optimisticResponse?: Unmasked<NoInfer<TData>> | ((vars: TVariables, { IGNORE }: {
|
|
116
118
|
IGNORE: IgnoreModifier;
|
|
117
119
|
}) => Unmasked<NoInfer<TData>> | IgnoreModifier);
|
|
118
120
|
/**
|
|
119
|
-
* A `MutationQueryReducersMap`, which is map from query names to
|
|
121
|
+
* A `MutationQueryReducersMap`, which is map from query names to
|
|
122
|
+
* mutation query reducers. Briefly, this map defines how to incorporate the
|
|
123
|
+
* results of the mutation into the results of queries that are currently
|
|
124
|
+
* being watched by your application.
|
|
120
125
|
*/
|
|
121
126
|
updateQueries?: MutationQueryReducersMap<TData>;
|
|
122
127
|
/**
|
|
@@ -128,9 +133,7 @@ export declare namespace ApolloClient {
|
|
|
128
133
|
*
|
|
129
134
|
* - A string indicating the operation name of the query to refetch
|
|
130
135
|
*
|
|
131
|
-
* @docGroup
|
|
132
|
-
*
|
|
133
|
-
* 1. Operation options
|
|
136
|
+
* @docGroup 1. Operation options
|
|
134
137
|
*/
|
|
135
138
|
refetchQueries?: ((result: NormalizedExecutionResult<Unmasked<TData>>) => InternalRefetchQueriesInclude) | InternalRefetchQueriesInclude;
|
|
136
139
|
/**
|
|
@@ -138,9 +141,7 @@ export declare namespace ApolloClient {
|
|
|
138
141
|
*
|
|
139
142
|
* The default value is `false` (queries are refetched asynchronously).
|
|
140
143
|
*
|
|
141
|
-
* @docGroup
|
|
142
|
-
*
|
|
143
|
-
* 1. Operation options
|
|
144
|
+
* @docGroup 1. Operation options
|
|
144
145
|
*/
|
|
145
146
|
awaitRefetchQueries?: boolean;
|
|
146
147
|
/**
|
|
@@ -148,9 +149,7 @@ export declare namespace ApolloClient {
|
|
|
148
149
|
*
|
|
149
150
|
* 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
|
*
|
|
151
|
-
* @docGroup
|
|
152
|
-
*
|
|
153
|
-
* 3. Caching options
|
|
152
|
+
* @docGroup 3. Caching options
|
|
154
153
|
*/
|
|
155
154
|
update?: MutationUpdaterFunction<TData, TVariables, TCache>;
|
|
156
155
|
/**
|
|
@@ -158,9 +157,7 @@ export declare namespace ApolloClient {
|
|
|
158
157
|
*
|
|
159
158
|
* 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
159
|
*
|
|
161
|
-
* @docGroup
|
|
162
|
-
*
|
|
163
|
-
* 1. Operation options
|
|
160
|
+
* @docGroup 1. Operation options
|
|
164
161
|
*/
|
|
165
162
|
onQueryUpdated?: OnQueryUpdated<any>;
|
|
166
163
|
/**
|
|
@@ -170,17 +167,13 @@ export declare namespace ApolloClient {
|
|
|
170
167
|
*
|
|
171
168
|
* The default value is `none`, meaning that the mutation result includes error details but _not_ partial results.
|
|
172
169
|
*
|
|
173
|
-
* @docGroup
|
|
174
|
-
*
|
|
175
|
-
* 1. Operation options
|
|
170
|
+
* @docGroup 1. Operation options
|
|
176
171
|
*/
|
|
177
172
|
errorPolicy?: ErrorPolicy;
|
|
178
173
|
/**
|
|
179
174
|
* 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
175
|
*
|
|
181
|
-
* @docGroup
|
|
182
|
-
*
|
|
183
|
-
* 2. Networking options
|
|
176
|
+
* @docGroup 2. Networking options
|
|
184
177
|
*/
|
|
185
178
|
context?: DefaultContext;
|
|
186
179
|
/**
|
|
@@ -190,21 +183,24 @@ export declare namespace ApolloClient {
|
|
|
190
183
|
*
|
|
191
184
|
* 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
185
|
*
|
|
193
|
-
* @docGroup
|
|
194
|
-
*
|
|
195
|
-
* 3. Caching options
|
|
186
|
+
* @docGroup 3. Caching options
|
|
196
187
|
*/
|
|
197
188
|
fetchPolicy?: MutationFetchPolicy;
|
|
198
189
|
/**
|
|
199
|
-
* To avoid retaining sensitive information from mutation root field
|
|
190
|
+
* To avoid retaining sensitive information from mutation root field
|
|
191
|
+
* arguments, Apollo Client v3.4+ automatically clears any `ROOT_MUTATION`
|
|
192
|
+
* fields from the cache after each mutation finishes. If you need this
|
|
193
|
+
* information to remain in the cache, you can prevent the removal by passing
|
|
194
|
+
* `keepRootFields: true` to the mutation. `ROOT_MUTATION` result data are
|
|
195
|
+
* also passed to the mutation `update` function, so we recommend obtaining
|
|
196
|
+
* the results that way, rather than using this option, if possible.
|
|
200
197
|
*/
|
|
201
198
|
keepRootFields?: boolean;
|
|
202
199
|
/**
|
|
203
|
-
* A GraphQL document, often created with `gql` from the `graphql-tag`
|
|
200
|
+
* A GraphQL document, often created with `gql` from the `graphql-tag`
|
|
201
|
+
* package, that contains a single mutation inside of it.
|
|
204
202
|
*
|
|
205
|
-
* @docGroup
|
|
206
|
-
*
|
|
207
|
-
* 1. Operation options
|
|
203
|
+
* @docGroup 1. Operation options
|
|
208
204
|
*/
|
|
209
205
|
mutation: DocumentNode | TypedDocumentNode<TData, TVariables>;
|
|
210
206
|
} & VariablesOption<NoInfer<TVariables>>;
|
|
@@ -231,9 +227,7 @@ export declare namespace ApolloClient {
|
|
|
231
227
|
/**
|
|
232
228
|
* A GraphQL query string parsed into an AST with the gql template literal.
|
|
233
229
|
*
|
|
234
|
-
* @docGroup
|
|
235
|
-
*
|
|
236
|
-
* 1. Operation options
|
|
230
|
+
* @docGroup 1. Operation options
|
|
237
231
|
*/
|
|
238
232
|
query: DocumentNode | TypedDocumentNode<TData, TVariables>;
|
|
239
233
|
/**
|
|
@@ -243,17 +237,13 @@ export declare namespace ApolloClient {
|
|
|
243
237
|
*
|
|
244
238
|
* The default value is `none`, meaning that the query result includes error details but not partial results.
|
|
245
239
|
*
|
|
246
|
-
* @docGroup
|
|
247
|
-
*
|
|
248
|
-
* 1. Operation options
|
|
240
|
+
* @docGroup 1. Operation options
|
|
249
241
|
*/
|
|
250
242
|
errorPolicy?: ErrorPolicy;
|
|
251
243
|
/**
|
|
252
244
|
* 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
245
|
*
|
|
254
|
-
* @docGroup
|
|
255
|
-
*
|
|
256
|
-
* 2. Networking options
|
|
246
|
+
* @docGroup 2. Networking options
|
|
257
247
|
*/
|
|
258
248
|
context?: DefaultContext;
|
|
259
249
|
/**
|
|
@@ -263,9 +253,7 @@ export declare namespace ApolloClient {
|
|
|
263
253
|
*
|
|
264
254
|
* The default value is `cache-first`.
|
|
265
255
|
*
|
|
266
|
-
* @docGroup
|
|
267
|
-
*
|
|
268
|
-
* 3. Caching options
|
|
256
|
+
* @docGroup 3. Caching options
|
|
269
257
|
*/
|
|
270
258
|
fetchPolicy?: FetchPolicy;
|
|
271
259
|
} & VariablesOption<NoInfer<TVariables>>;
|
|
@@ -275,19 +263,16 @@ export declare namespace ApolloClient {
|
|
|
275
263
|
*
|
|
276
264
|
* This value might be `undefined` if a query results in one or more errors (depending on the query's `errorPolicy`).
|
|
277
265
|
*
|
|
278
|
-
* @docGroup
|
|
279
|
-
*
|
|
280
|
-
* 1. Operation data
|
|
266
|
+
* @docGroup 1. Operation data
|
|
281
267
|
*/
|
|
282
268
|
data: TData | undefined;
|
|
283
269
|
/**
|
|
284
|
-
* A single ErrorLike object describing the error that occured during the latest
|
|
270
|
+
* A single ErrorLike object describing the error that occured during the latest
|
|
271
|
+
* query execution.
|
|
285
272
|
*
|
|
286
273
|
* For more information, see [Handling operation errors](https://www.apollographql.com/docs/react/data/error-handling/).
|
|
287
274
|
*
|
|
288
|
-
* @docGroup
|
|
289
|
-
*
|
|
290
|
-
* 1. Operation data
|
|
275
|
+
* @docGroup 1. Operation data
|
|
291
276
|
*/
|
|
292
277
|
error?: ErrorLike;
|
|
293
278
|
}
|
|
@@ -349,7 +334,8 @@ export declare namespace ApolloClient {
|
|
|
349
334
|
}
|
|
350
335
|
type SubscribeOptions<TData = unknown, TVariables extends OperationVariables = OperationVariables> = {
|
|
351
336
|
/**
|
|
352
|
-
* A GraphQL document, often created with `gql` from the `graphql-tag`
|
|
337
|
+
* A GraphQL document, often created with `gql` from the `graphql-tag`
|
|
338
|
+
* package, that contains a single subscription inside of it.
|
|
353
339
|
*/
|
|
354
340
|
query: DocumentNode | TypedDocumentNode<TData, TVariables>;
|
|
355
341
|
/**
|
|
@@ -398,33 +384,30 @@ export declare namespace ApolloClient {
|
|
|
398
384
|
*
|
|
399
385
|
* The default value is `cache-first`.
|
|
400
386
|
*
|
|
401
|
-
* @docGroup
|
|
402
|
-
*
|
|
403
|
-
* 3. Caching options
|
|
387
|
+
* @docGroup 3. Caching options
|
|
404
388
|
*/
|
|
405
389
|
fetchPolicy?: WatchQueryFetchPolicy;
|
|
406
390
|
/**
|
|
407
391
|
* Specifies the `FetchPolicy` to be used after this query has completed.
|
|
408
392
|
*
|
|
409
|
-
* @docGroup
|
|
410
|
-
*
|
|
411
|
-
* 3. Caching options
|
|
393
|
+
* @docGroup 3. Caching options
|
|
412
394
|
*/
|
|
413
395
|
nextFetchPolicy?: WatchQueryFetchPolicy | ((this: WatchQueryOptions<TData, TVariables>, currentFetchPolicy: WatchQueryFetchPolicy, context: NextFetchPolicyContext<TData, TVariables>) => WatchQueryFetchPolicy);
|
|
414
396
|
/**
|
|
415
|
-
* Defaults to the initial value of options.fetchPolicy, but can be explicitly
|
|
397
|
+
* Defaults to the initial value of options.fetchPolicy, but can be explicitly
|
|
398
|
+
* configured to specify the WatchQueryFetchPolicy to revert back to whenever
|
|
399
|
+
* variables change (unless nextFetchPolicy intervenes).
|
|
416
400
|
*
|
|
417
|
-
* @docGroup
|
|
418
|
-
*
|
|
419
|
-
* 3. Caching options
|
|
401
|
+
* @docGroup 3. Caching options
|
|
420
402
|
*/
|
|
421
403
|
initialFetchPolicy?: WatchQueryFetchPolicy;
|
|
422
404
|
/**
|
|
423
|
-
* Specifies whether a `NetworkStatus.refetch` operation should merge
|
|
424
|
-
*
|
|
425
|
-
*
|
|
405
|
+
* Specifies whether a `NetworkStatus.refetch` operation should merge
|
|
406
|
+
* incoming field data with existing data, or overwrite the existing data.
|
|
407
|
+
* Overwriting is probably preferable, but merging is currently the default
|
|
408
|
+
* behavior, for backwards compatibility with Apollo Client 3.x.
|
|
426
409
|
*
|
|
427
|
-
* 3. Caching options
|
|
410
|
+
* @docGroup 3. Caching options
|
|
428
411
|
*/
|
|
429
412
|
refetchWritePolicy?: RefetchWritePolicy;
|
|
430
413
|
/**
|
|
@@ -434,17 +417,13 @@ export declare namespace ApolloClient {
|
|
|
434
417
|
*
|
|
435
418
|
* The default value is `none`, meaning that the query result includes error details but not partial results.
|
|
436
419
|
*
|
|
437
|
-
* @docGroup
|
|
438
|
-
*
|
|
439
|
-
* 1. Operation options
|
|
420
|
+
* @docGroup 1. Operation options
|
|
440
421
|
*/
|
|
441
422
|
errorPolicy?: ErrorPolicy;
|
|
442
423
|
/**
|
|
443
424
|
* 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
425
|
*
|
|
445
|
-
* @docGroup
|
|
446
|
-
*
|
|
447
|
-
* 2. Networking options
|
|
426
|
+
* @docGroup 2. Networking options
|
|
448
427
|
*/
|
|
449
428
|
context?: DefaultContext;
|
|
450
429
|
/**
|
|
@@ -452,9 +431,7 @@ export declare namespace ApolloClient {
|
|
|
452
431
|
*
|
|
453
432
|
* The default value is `0` (no polling).
|
|
454
433
|
*
|
|
455
|
-
* @docGroup
|
|
456
|
-
*
|
|
457
|
-
* 2. Networking options
|
|
434
|
+
* @docGroup 2. Networking options
|
|
458
435
|
*/
|
|
459
436
|
pollInterval?: number;
|
|
460
437
|
/**
|
|
@@ -462,9 +439,7 @@ export declare namespace ApolloClient {
|
|
|
462
439
|
*
|
|
463
440
|
* The default value is `true`.
|
|
464
441
|
*
|
|
465
|
-
* @docGroup
|
|
466
|
-
*
|
|
467
|
-
* 2. Networking options
|
|
442
|
+
* @docGroup 2. Networking options
|
|
468
443
|
*/
|
|
469
444
|
notifyOnNetworkStatusChange?: boolean;
|
|
470
445
|
/**
|
|
@@ -472,25 +447,21 @@ export declare namespace ApolloClient {
|
|
|
472
447
|
*
|
|
473
448
|
* The default value is `false`.
|
|
474
449
|
*
|
|
475
|
-
* @docGroup
|
|
476
|
-
*
|
|
477
|
-
* 3. Caching options
|
|
450
|
+
* @docGroup 3. Caching options
|
|
478
451
|
*/
|
|
479
452
|
returnPartialData?: boolean;
|
|
480
453
|
/**
|
|
481
|
-
* A callback function that's called whenever a refetch attempt occurs
|
|
482
|
-
*
|
|
483
|
-
*
|
|
454
|
+
* A callback function that's called whenever a refetch attempt occurs
|
|
455
|
+
* while polling. If the function returns `true`, the refetch is
|
|
456
|
+
* skipped and not reattempted until the next poll interval.
|
|
484
457
|
*
|
|
485
|
-
* 2. Networking options
|
|
458
|
+
* @docGroup 2. Networking options
|
|
486
459
|
*/
|
|
487
460
|
skipPollAttempt?: () => boolean;
|
|
488
461
|
/**
|
|
489
462
|
* A GraphQL query string parsed into an AST with the gql template literal.
|
|
490
463
|
*
|
|
491
|
-
* @docGroup
|
|
492
|
-
*
|
|
493
|
-
* 1. Operation options
|
|
464
|
+
* @docGroup 1. Operation options
|
|
494
465
|
*/
|
|
495
466
|
query: DocumentNode | TypedDocumentNode<TData, TVariables>;
|
|
496
467
|
} & VariablesOption<NoInfer<TVariables>>;
|
|
@@ -802,10 +773,14 @@ export declare class ApolloClient {
|
|
|
802
773
|
*/
|
|
803
774
|
readQuery<TData = unknown, TVariables extends OperationVariables = OperationVariables>(options: ApolloClient.ReadQueryOptions<TData, TVariables>): Unmasked<TData> | null;
|
|
804
775
|
/**
|
|
805
|
-
* Tries to read some data from the store in the shape of the provided
|
|
806
|
-
*
|
|
807
|
-
*
|
|
776
|
+
* Tries to read some data from the store in the shape of the provided
|
|
777
|
+
* GraphQL query without making a network request. This method will start at
|
|
778
|
+
* the root query. To start at a specific id returned by `cache.identify`
|
|
779
|
+
* use `readFragment`.
|
|
808
780
|
*
|
|
781
|
+
* @param optimistic - Set to `true` to allow `readQuery` to return
|
|
782
|
+
* optimistic results. Is `false` by default.
|
|
783
|
+
*
|
|
809
784
|
*
|
|
810
785
|
* @deprecated Pass the `optimistic` argument as part of the first argument
|
|
811
786
|
* instead of passing it as a separate option.
|
|
@@ -849,12 +824,19 @@ export declare class ApolloClient {
|
|
|
849
824
|
*/
|
|
850
825
|
readFragment<TData = unknown, TVariables extends OperationVariables = OperationVariables>(options: ApolloClient.ReadFragmentOptions<TData, TVariables>): Unmasked<TData> | null;
|
|
851
826
|
/**
|
|
852
|
-
* Tries to read some data from the store in the shape of the provided
|
|
853
|
-
*
|
|
854
|
-
*
|
|
827
|
+
* Tries to read some data from the store in the shape of the provided
|
|
828
|
+
* GraphQL fragment without making a network request. This method will read a
|
|
829
|
+
* GraphQL fragment from any arbitrary id that is currently cached, unlike
|
|
830
|
+
* `readQuery` which will only read from the root query.
|
|
855
831
|
*
|
|
856
|
-
*
|
|
832
|
+
* You must pass in a GraphQL document with a single fragment or a document
|
|
833
|
+
* with multiple fragments that represent what you are reading. If you pass
|
|
834
|
+
* in a document with multiple fragments then you must also specify a
|
|
835
|
+
* `fragmentName`.
|
|
857
836
|
*
|
|
837
|
+
* @param optimistic - Set to `true` to allow `readFragment` to return
|
|
838
|
+
* optimistic results. Is `false` by default.
|
|
839
|
+
*
|
|
858
840
|
*
|
|
859
841
|
* @deprecated Pass the `optimistic` argument as part of the first argument
|
|
860
842
|
* instead of passing it as a separate option.
|
|
@@ -879,7 +861,7 @@ export declare class ApolloClient {
|
|
|
879
861
|
*/
|
|
880
862
|
writeFragment<TData = unknown, TVariables extends OperationVariables = OperationVariables>(options: ApolloClient.WriteFragmentOptions<TData, TVariables>): Reference | undefined;
|
|
881
863
|
__actionHookForDevTools(cb: () => any): void;
|
|
882
|
-
__requestRaw(
|
|
864
|
+
__requestRaw(request: ApolloLink.Request): Observable<ApolloLink.Result<unknown>>;
|
|
883
865
|
/**
|
|
884
866
|
* Resets your entire store by clearing out your cache and then re-executing
|
|
885
867
|
* all of your active queries. This makes it so that you may guarantee that
|
|
@@ -18,33 +18,30 @@ export declare namespace ObservableQuery {
|
|
|
18
18
|
*
|
|
19
19
|
* The default value is `cache-first`.
|
|
20
20
|
*
|
|
21
|
-
* @docGroup
|
|
22
|
-
*
|
|
23
|
-
* 3. Caching options
|
|
21
|
+
* @docGroup 3. Caching options
|
|
24
22
|
*/
|
|
25
23
|
fetchPolicy: WatchQueryFetchPolicy;
|
|
26
24
|
/**
|
|
27
25
|
* Specifies the `FetchPolicy` to be used after this query has completed.
|
|
28
26
|
*
|
|
29
|
-
* @docGroup
|
|
30
|
-
*
|
|
31
|
-
* 3. Caching options
|
|
27
|
+
* @docGroup 3. Caching options
|
|
32
28
|
*/
|
|
33
29
|
nextFetchPolicy?: WatchQueryFetchPolicy | ((this: ApolloClient.WatchQueryOptions<TData, TVariables>, currentFetchPolicy: WatchQueryFetchPolicy, context: NextFetchPolicyContext<TData, TVariables>) => WatchQueryFetchPolicy);
|
|
34
30
|
/**
|
|
35
|
-
* Defaults to the initial value of options.fetchPolicy, but can be explicitly
|
|
31
|
+
* Defaults to the initial value of options.fetchPolicy, but can be explicitly
|
|
32
|
+
* configured to specify the WatchQueryFetchPolicy to revert back to whenever
|
|
33
|
+
* variables change (unless nextFetchPolicy intervenes).
|
|
36
34
|
*
|
|
37
|
-
* @docGroup
|
|
38
|
-
*
|
|
39
|
-
* 3. Caching options
|
|
35
|
+
* @docGroup 3. Caching options
|
|
40
36
|
*/
|
|
41
37
|
initialFetchPolicy: WatchQueryFetchPolicy;
|
|
42
38
|
/**
|
|
43
|
-
* Specifies whether a `NetworkStatus.refetch` operation should merge
|
|
44
|
-
*
|
|
45
|
-
*
|
|
39
|
+
* Specifies whether a `NetworkStatus.refetch` operation should merge
|
|
40
|
+
* incoming field data with existing data, or overwrite the existing data.
|
|
41
|
+
* Overwriting is probably preferable, but merging is currently the default
|
|
42
|
+
* behavior, for backwards compatibility with Apollo Client 3.x.
|
|
46
43
|
*
|
|
47
|
-
* 3. Caching options
|
|
44
|
+
* @docGroup 3. Caching options
|
|
48
45
|
*/
|
|
49
46
|
refetchWritePolicy?: RefetchWritePolicy;
|
|
50
47
|
/**
|
|
@@ -54,17 +51,13 @@ export declare namespace ObservableQuery {
|
|
|
54
51
|
*
|
|
55
52
|
* The default value is `none`, meaning that the query result includes error details but not partial results.
|
|
56
53
|
*
|
|
57
|
-
* @docGroup
|
|
58
|
-
*
|
|
59
|
-
* 1. Operation options
|
|
54
|
+
* @docGroup 1. Operation options
|
|
60
55
|
*/
|
|
61
56
|
errorPolicy?: ErrorPolicy;
|
|
62
57
|
/**
|
|
63
58
|
* 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.
|
|
64
59
|
*
|
|
65
|
-
* @docGroup
|
|
66
|
-
*
|
|
67
|
-
* 2. Networking options
|
|
60
|
+
* @docGroup 2. Networking options
|
|
68
61
|
*/
|
|
69
62
|
context?: DefaultContext;
|
|
70
63
|
/**
|
|
@@ -72,9 +65,7 @@ export declare namespace ObservableQuery {
|
|
|
72
65
|
*
|
|
73
66
|
* The default value is `0` (no polling).
|
|
74
67
|
*
|
|
75
|
-
* @docGroup
|
|
76
|
-
*
|
|
77
|
-
* 2. Networking options
|
|
68
|
+
* @docGroup 2. Networking options
|
|
78
69
|
*/
|
|
79
70
|
pollInterval?: number;
|
|
80
71
|
/**
|
|
@@ -82,9 +73,7 @@ export declare namespace ObservableQuery {
|
|
|
82
73
|
*
|
|
83
74
|
* The default value is `true`.
|
|
84
75
|
*
|
|
85
|
-
* @docGroup
|
|
86
|
-
*
|
|
87
|
-
* 2. Networking options
|
|
76
|
+
* @docGroup 2. Networking options
|
|
88
77
|
*/
|
|
89
78
|
notifyOnNetworkStatusChange?: boolean;
|
|
90
79
|
/**
|
|
@@ -92,25 +81,21 @@ export declare namespace ObservableQuery {
|
|
|
92
81
|
*
|
|
93
82
|
* The default value is `false`.
|
|
94
83
|
*
|
|
95
|
-
* @docGroup
|
|
96
|
-
*
|
|
97
|
-
* 3. Caching options
|
|
84
|
+
* @docGroup 3. Caching options
|
|
98
85
|
*/
|
|
99
86
|
returnPartialData?: boolean;
|
|
100
87
|
/**
|
|
101
|
-
* A callback function that's called whenever a refetch attempt occurs
|
|
88
|
+
* A callback function that's called whenever a refetch attempt occurs
|
|
89
|
+
* while polling. If the function returns `true`, the refetch is
|
|
90
|
+
* skipped and not reattempted until the next poll interval.
|
|
102
91
|
*
|
|
103
|
-
* @docGroup
|
|
104
|
-
*
|
|
105
|
-
* 2. Networking options
|
|
92
|
+
* @docGroup 2. Networking options
|
|
106
93
|
*/
|
|
107
94
|
skipPollAttempt?: () => boolean;
|
|
108
95
|
/**
|
|
109
96
|
* A GraphQL query string parsed into an AST with the gql template literal.
|
|
110
97
|
*
|
|
111
|
-
* @docGroup
|
|
112
|
-
*
|
|
113
|
-
* 1. Operation options
|
|
98
|
+
* @docGroup 1. Operation options
|
|
114
99
|
*/
|
|
115
100
|
query: DocumentNode | TypedDocumentNode<TData, TVariables>;
|
|
116
101
|
/**
|
|
@@ -118,9 +103,7 @@ export declare namespace ObservableQuery {
|
|
|
118
103
|
*
|
|
119
104
|
* Each key in the object corresponds to a variable name, and that key's value corresponds to the variable value.
|
|
120
105
|
*
|
|
121
|
-
* @docGroup
|
|
122
|
-
*
|
|
123
|
-
* 1. Operation options
|
|
106
|
+
* @docGroup 1. Operation options
|
|
124
107
|
*/
|
|
125
108
|
variables: TVariables;
|
|
126
109
|
};
|
|
@@ -128,9 +111,7 @@ export declare namespace ObservableQuery {
|
|
|
128
111
|
/**
|
|
129
112
|
* A GraphQL query string parsed into an AST with the gql template literal.
|
|
130
113
|
*
|
|
131
|
-
* @docGroup
|
|
132
|
-
*
|
|
133
|
-
* 1. Operation options
|
|
114
|
+
* @docGroup 1. Operation options
|
|
134
115
|
*/
|
|
135
116
|
query?: DocumentNode | TypedDocumentNode<TFetchData, TFetchVars>;
|
|
136
117
|
/**
|
|
@@ -138,9 +119,7 @@ export declare namespace ObservableQuery {
|
|
|
138
119
|
*
|
|
139
120
|
* Each key in the object corresponds to a variable name, and that key's value corresponds to the variable value.
|
|
140
121
|
*
|
|
141
|
-
* @docGroup
|
|
142
|
-
*
|
|
143
|
-
* 1. Operation options
|
|
122
|
+
* @docGroup 1. Operation options
|
|
144
123
|
*/
|
|
145
124
|
variables?: Partial<NoInfer<TFetchVars>>;
|
|
146
125
|
/**
|
|
@@ -150,17 +129,13 @@ export declare namespace ObservableQuery {
|
|
|
150
129
|
*
|
|
151
130
|
* The default value is `none`, meaning that the query result includes error details but not partial results.
|
|
152
131
|
*
|
|
153
|
-
* @docGroup
|
|
154
|
-
*
|
|
155
|
-
* 1. Operation options
|
|
132
|
+
* @docGroup 1. Operation options
|
|
156
133
|
*/
|
|
157
134
|
errorPolicy?: ErrorPolicy;
|
|
158
135
|
/**
|
|
159
136
|
* 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.
|
|
160
137
|
*
|
|
161
|
-
* @docGroup
|
|
162
|
-
*
|
|
163
|
-
* 2. Networking options
|
|
138
|
+
* @docGroup 2. Networking options
|
|
164
139
|
*/
|
|
165
140
|
context?: DefaultContext;
|
|
166
141
|
updateQuery?: (previousQueryResult: Unmasked<TData>, options: {
|
|
@@ -200,21 +175,18 @@ export declare namespace ObservableQuery {
|
|
|
200
175
|
}
|
|
201
176
|
type Result<TData, TStates extends DataState<TData>["dataState"] = DataState<TData>["dataState"]> = {
|
|
202
177
|
/**
|
|
203
|
-
* A single ErrorLike object describing the error that occured during the latest
|
|
178
|
+
* A single ErrorLike object describing the error that occured during the latest
|
|
179
|
+
* query execution.
|
|
204
180
|
*
|
|
205
181
|
* For more information, see [Handling operation errors](https://www.apollographql.com/docs/react/data/error-handling/).
|
|
206
182
|
*
|
|
207
|
-
* @docGroup
|
|
208
|
-
*
|
|
209
|
-
* 1. Operation data
|
|
183
|
+
* @docGroup 1. Operation data
|
|
210
184
|
*/
|
|
211
185
|
error?: ErrorLike;
|
|
212
186
|
/**
|
|
213
187
|
* If `true`, the query is still in flight and results have not yet been returned.
|
|
214
188
|
*
|
|
215
|
-
* @docGroup
|
|
216
|
-
*
|
|
217
|
-
* 2. Network info
|
|
189
|
+
* @docGroup 2. Network info
|
|
218
190
|
*/
|
|
219
191
|
loading: boolean;
|
|
220
192
|
/**
|
|
@@ -222,21 +194,15 @@ export declare namespace ObservableQuery {
|
|
|
222
194
|
*
|
|
223
195
|
* Used in conjunction with the [`notifyOnNetworkStatusChange`](#notifyonnetworkstatuschange) option.
|
|
224
196
|
*
|
|
225
|
-
* @docGroup
|
|
226
|
-
*
|
|
227
|
-
* 2. Network info
|
|
197
|
+
* @docGroup 2. Network info
|
|
228
198
|
*/
|
|
229
199
|
networkStatus: NetworkStatus;
|
|
230
200
|
/**
|
|
231
|
-
* Describes whether `data` is a complete or partial result. This flag is only
|
|
232
|
-
*
|
|
233
|
-
* @deprecated
|
|
234
|
-
*
|
|
235
|
-
* This field will be removed in a future version of Apollo Client.
|
|
201
|
+
* Describes whether `data` is a complete or partial result. This flag is only
|
|
202
|
+
* set when `returnPartialData` is `true` in query options.
|
|
236
203
|
*
|
|
237
|
-
* @
|
|
238
|
-
*
|
|
239
|
-
* 1. Operation data
|
|
204
|
+
* @deprecated This field will be removed in a future version of Apollo Client.
|
|
205
|
+
* @docGroup 1. Operation data
|
|
240
206
|
*/
|
|
241
207
|
partial: boolean;
|
|
242
208
|
} & GetDataState<TData, TStates>;
|
|
@@ -262,9 +228,8 @@ export declare namespace ObservableQuery {
|
|
|
262
228
|
/**
|
|
263
229
|
* Used to stitch together functional operators into a chain.
|
|
264
230
|
*
|
|
265
|
-
* @returns The Observable result of all the operators having been called in the order they were passed in.
|
|
266
|
-
*
|
|
267
231
|
* @example
|
|
232
|
+
*
|
|
268
233
|
* ```ts
|
|
269
234
|
* import { filter, map } from 'rxjs';
|
|
270
235
|
*
|
|
@@ -275,13 +240,15 @@ export declare namespace ObservableQuery {
|
|
|
275
240
|
* )
|
|
276
241
|
* .subscribe(x => console.log(x));
|
|
277
242
|
* ```
|
|
243
|
+
*
|
|
244
|
+
* @returns The Observable result of all the operators having been called
|
|
245
|
+
* in the order they were passed in.
|
|
278
246
|
*/
|
|
279
247
|
pipe(...operators: OperatorFunctionChain<ObservableQuery.Result<TData>, OperatorResult>): Observable<OperatorResult>;
|
|
280
248
|
/**
|
|
281
249
|
* Subscribes to the `ObservableQuery`.
|
|
282
|
-
*
|
|
283
|
-
*
|
|
284
|
-
*
|
|
250
|
+
* @param observerOrNext - Either an RxJS `Observer` with some or all callback methods,
|
|
251
|
+
* or the `next` handler that is called for each value emitted from the subscribed Observable.
|
|
285
252
|
* @returns A subscription reference to the registered handlers.
|
|
286
253
|
*/
|
|
287
254
|
subscribe(observerOrNext: Partial<Observer<ObservableQuery.Result<MaybeMasked<TData>>>> | ((value: ObservableQuery.Result<MaybeMasked<TData>>) => void)): Subscription;
|