@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
|
@@ -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;
|
package/core/QueryInfo.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { DocumentNode, FormattedExecutionResult } from "graphql";
|
|
2
2
|
import type { ApolloCache } from "@apollo/client/cache";
|
|
3
|
-
import type {
|
|
3
|
+
import type { ApolloLink } from "@apollo/client/link";
|
|
4
4
|
import type { Unmasked } from "@apollo/client/masking";
|
|
5
5
|
import type { ApolloClient } from "./ApolloClient.js";
|
|
6
6
|
import type { ObservableQuery } from "./ObservableQuery.js";
|
|
@@ -46,8 +46,8 @@ export declare class QueryInfo<TData, TVariables extends OperationVariables = Op
|
|
|
46
46
|
private shouldWrite;
|
|
47
47
|
get hasNext(): boolean;
|
|
48
48
|
private maybeHandleIncrementalResult;
|
|
49
|
-
markQueryResult(incoming:
|
|
50
|
-
markMutationResult(incoming:
|
|
49
|
+
markQueryResult(incoming: ApolloLink.Result<TData>, { document: query, variables, errorPolicy, cacheWriteBehavior, }: OperationInfo<TData, TVariables>): FormattedExecutionResult<DataValue.Complete<TData> | DataValue.Streaming<TData>>;
|
|
50
|
+
markMutationResult(incoming: ApolloLink.Result<TData>, mutation: OperationInfo<TData, TVariables, CacheWriteBehavior.FORBID | CacheWriteBehavior.MERGE> & {
|
|
51
51
|
context?: DefaultContext;
|
|
52
52
|
updateQueries: UpdateQueries<TData>;
|
|
53
53
|
update?: MutationUpdaterFunction<TData, TVariables, TCache>;
|