@apollo/client 4.0.0-alpha.2 → 4.0.0-alpha.4
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/.changeset/eighty-squids-fix.md +15 -0
- package/.changeset/four-ghosts-watch.md +5 -0
- package/.changeset/funny-jeans-invent.md +16 -0
- package/.changeset/khaki-spies-work.md +11 -0
- package/.changeset/light-apes-rescue.md +5 -0
- package/.changeset/odd-lemons-relax.md +5 -0
- package/.changeset/pre.json +7 -0
- package/.changeset/unlucky-kiwis-sell.md +5 -0
- package/CHANGELOG.md +58 -0
- package/__cjs/core/ApolloClient.cjs +22 -13
- package/__cjs/core/ApolloClient.cjs.map +1 -1
- package/__cjs/core/ApolloClient.d.cts +13 -1
- package/__cjs/core/ObservableQuery.cjs +29 -10
- package/__cjs/core/ObservableQuery.cjs.map +1 -1
- package/__cjs/core/ObservableQuery.d.cts +6 -3
- package/__cjs/core/QueryInfo.cjs +8 -7
- package/__cjs/core/QueryInfo.cjs.map +1 -1
- package/__cjs/core/QueryInfo.d.cts +1 -0
- package/__cjs/core/QueryManager.cjs +36 -10
- package/__cjs/core/QueryManager.cjs.map +1 -1
- package/__cjs/core/QueryManager.d.cts +11 -0
- package/__cjs/core/watchQueryOptions.d.cts +18 -25
- package/__cjs/react/hooks/index.cjs +13 -8
- package/__cjs/react/hooks/index.cjs.map +1 -1
- package/__cjs/react/hooks/index.d.cts +6 -12
- package/__cjs/react/hooks/useBackgroundQuery.cjs.map +1 -1
- package/__cjs/react/hooks/useBackgroundQuery.d.cts +146 -43
- package/__cjs/react/hooks/useFragment.cjs.map +1 -1
- package/__cjs/react/hooks/useFragment.d.cts +51 -26
- package/__cjs/react/hooks/useLazyQuery.cjs +1 -1
- package/__cjs/react/hooks/useLazyQuery.cjs.map +1 -1
- package/__cjs/react/hooks/useLazyQuery.d.cts +263 -266
- package/__cjs/react/hooks/useLoadableQuery.cjs.map +1 -1
- package/__cjs/react/hooks/useLoadableQuery.d.cts +105 -32
- package/__cjs/react/hooks/useMutation.cjs.map +1 -1
- package/__cjs/react/hooks/useMutation.d.cts +198 -3
- package/__cjs/react/hooks/useQuery.cjs +9 -12
- package/__cjs/react/hooks/useQuery.cjs.map +1 -1
- package/__cjs/react/hooks/useQuery.d.cts +279 -4
- package/__cjs/react/hooks/useQueryRefHandlers.cjs.map +1 -1
- package/__cjs/react/hooks/useQueryRefHandlers.d.cts +21 -20
- package/__cjs/react/hooks/useReadQuery.cjs.map +1 -1
- package/__cjs/react/hooks/useReadQuery.d.cts +26 -24
- package/__cjs/react/hooks/useSubscription.cjs.map +1 -1
- package/__cjs/react/hooks/useSubscription.d.cts +127 -4
- package/__cjs/react/hooks/useSuspenseFragment.cjs.map +1 -1
- package/__cjs/react/hooks/useSuspenseFragment.d.cts +40 -37
- package/__cjs/react/hooks/useSuspenseQuery.cjs.map +1 -1
- package/__cjs/react/hooks/useSuspenseQuery.d.cts +202 -35
- package/__cjs/react/index.cjs.map +1 -1
- package/__cjs/react/index.d.cts +2 -1
- package/__cjs/react/internal/cache/QueryReference.cjs +2 -8
- package/__cjs/react/internal/cache/QueryReference.cjs.map +1 -1
- package/__cjs/react/internal/index.cjs.map +1 -1
- package/__cjs/react/internal/index.d.cts +1 -0
- package/__cjs/react/internal/types.d.cts +46 -0
- package/__cjs/react/query-preloader/createQueryPreloader.cjs.map +1 -1
- package/__cjs/react/query-preloader/createQueryPreloader.d.cts +2 -3
- package/__cjs/react/ssr/RenderPromises.cjs.map +1 -1
- package/__cjs/react/ssr/RenderPromises.d.cts +6 -3
- package/__cjs/react/types/deprecated.cjs +3 -0
- package/__cjs/react/types/deprecated.cjs.map +1 -0
- package/__cjs/react/types/deprecated.d.cts +65 -0
- package/__cjs/react/types/types.documentation.d.cts +0 -8
- package/__cjs/testing/matchers/index.cjs +2 -0
- package/__cjs/testing/matchers/index.cjs.map +1 -1
- package/__cjs/testing/matchers/toEqualLazyQueryResult.cjs.map +1 -1
- package/__cjs/testing/matchers/toEqualLazyQueryResult.d.cts +2 -2
- package/__cjs/testing/matchers/toEqualQueryResult.cjs +0 -1
- package/__cjs/testing/matchers/toEqualQueryResult.cjs.map +1 -1
- package/__cjs/testing/matchers/toEqualQueryResult.d.cts +3 -3
- package/__cjs/testing/matchers/toEqualStrictTyped.cjs +44 -0
- package/__cjs/testing/matchers/toEqualStrictTyped.cjs.map +1 -0
- package/__cjs/testing/matchers/toEqualStrictTyped.d.cts +3 -0
- package/__cjs/version.cjs +1 -1
- package/__cjs/version.d.cts +1 -1
- package/core/ApolloClient.d.ts +13 -1
- package/core/ApolloClient.js +22 -13
- package/core/ApolloClient.js.map +1 -1
- package/core/ObservableQuery.d.ts +6 -3
- package/core/ObservableQuery.js +29 -10
- package/core/ObservableQuery.js.map +1 -1
- package/core/QueryInfo.d.ts +1 -0
- package/core/QueryInfo.js +8 -7
- package/core/QueryInfo.js.map +1 -1
- package/core/QueryManager.d.ts +11 -0
- package/core/QueryManager.js +36 -10
- package/core/QueryManager.js.map +1 -1
- package/core/watchQueryOptions.d.ts +18 -25
- package/package.json +1 -1
- package/react/hooks/index.d.ts +6 -12
- package/react/hooks/index.js +6 -6
- package/react/hooks/index.js.map +1 -1
- package/react/hooks/useBackgroundQuery.d.ts +146 -43
- package/react/hooks/useBackgroundQuery.js.map +1 -1
- package/react/hooks/useFragment.d.ts +51 -26
- package/react/hooks/useFragment.js.map +1 -1
- package/react/hooks/useLazyQuery.d.ts +263 -266
- package/react/hooks/useLazyQuery.js +1 -1
- package/react/hooks/useLazyQuery.js.map +1 -1
- package/react/hooks/useLoadableQuery.d.ts +105 -32
- package/react/hooks/useLoadableQuery.js.map +1 -1
- package/react/hooks/useMutation.d.ts +198 -3
- package/react/hooks/useMutation.js.map +1 -1
- package/react/hooks/useQuery.d.ts +279 -4
- package/react/hooks/useQuery.js +9 -12
- package/react/hooks/useQuery.js.map +1 -1
- package/react/hooks/useQueryRefHandlers.d.ts +21 -20
- package/react/hooks/useQueryRefHandlers.js.map +1 -1
- package/react/hooks/useReadQuery.d.ts +26 -24
- package/react/hooks/useReadQuery.js.map +1 -1
- package/react/hooks/useSubscription.d.ts +127 -4
- package/react/hooks/useSubscription.js.map +1 -1
- package/react/hooks/useSuspenseFragment.d.ts +40 -37
- package/react/hooks/useSuspenseFragment.js.map +1 -1
- package/react/hooks/useSuspenseQuery.d.ts +202 -35
- package/react/hooks/useSuspenseQuery.js.map +1 -1
- package/react/index.d.ts +2 -1
- package/react/index.js.map +1 -1
- package/react/internal/cache/QueryReference.js +2 -8
- package/react/internal/cache/QueryReference.js.map +1 -1
- package/react/internal/index.d.ts +1 -0
- package/react/internal/index.js.map +1 -1
- package/react/internal/types.d.ts +46 -0
- package/react/query-preloader/createQueryPreloader.d.ts +2 -3
- package/react/query-preloader/createQueryPreloader.js.map +1 -1
- package/react/ssr/RenderPromises.d.ts +6 -3
- package/react/ssr/RenderPromises.js.map +1 -1
- package/react/types/deprecated.d.ts +65 -0
- package/react/types/deprecated.js +2 -0
- package/react/types/deprecated.js.map +1 -0
- package/react/types/types.documentation.d.ts +0 -8
- package/testing/matchers/index.js +2 -0
- package/testing/matchers/index.js.map +1 -1
- package/testing/matchers/toEqualLazyQueryResult.d.ts +2 -2
- package/testing/matchers/toEqualLazyQueryResult.js.map +1 -1
- package/testing/matchers/toEqualQueryResult.d.ts +3 -3
- package/testing/matchers/toEqualQueryResult.js +0 -1
- package/testing/matchers/toEqualQueryResult.js.map +1 -1
- package/testing/matchers/toEqualStrictTyped.d.ts +3 -0
- package/testing/matchers/toEqualStrictTyped.js +40 -0
- package/testing/matchers/toEqualStrictTyped.js.map +1 -0
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/__cjs/react/types/types.d.cts +0 -671
- package/react/types/types.d.ts +0 -671
- /package/__cjs/react/{types → internal}/types.cjs +0 -0
- /package/__cjs/react/{types → internal}/types.cjs.map +0 -0
- /package/react/{types → internal}/types.js +0 -0
- /package/react/{types → internal}/types.js.map +0 -0
|
@@ -2,273 +2,270 @@ import type { TypedDocumentNode } from "@graphql-typed-document-node/core";
|
|
|
2
2
|
import type { DocumentNode } from "graphql";
|
|
3
3
|
import type { ApolloClient, ApolloQueryResult, DefaultContext, ErrorLike, ErrorPolicy, FetchMoreQueryOptions, MaybeMasked, ObservableQuery, OperationVariables, RefetchWritePolicy, SubscribeToMoreFunction, Unmasked, UpdateQueryMapFn, WatchQueryFetchPolicy, WatchQueryOptions } from "@apollo/client/core";
|
|
4
4
|
import { NetworkStatus } from "@apollo/client/core";
|
|
5
|
-
import type {
|
|
6
|
-
import type {
|
|
7
|
-
import type { OnlyRequiredProperties } from "@apollo/client/utilities";
|
|
5
|
+
import type { VariablesOption } from "@apollo/client/react/internal";
|
|
6
|
+
import type { NoInfer, OnlyRequiredProperties } from "@apollo/client/utilities";
|
|
8
7
|
import type { NextFetchPolicyContext } from "../../core/watchQueryOptions.cjs";
|
|
9
|
-
export
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
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
|
-
|
|
104
|
-
|
|
105
|
-
|
|
8
|
+
export declare namespace useLazyQuery {
|
|
9
|
+
interface Options<TData = unknown, TVariables extends OperationVariables = OperationVariables> {
|
|
10
|
+
/**
|
|
11
|
+
* 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).
|
|
12
|
+
*
|
|
13
|
+
* For details, see [Setting a fetch policy](https://www.apollographql.com/docs/react/data/queries/#setting-a-fetch-policy).
|
|
14
|
+
*
|
|
15
|
+
* The default value is `cache-first`.
|
|
16
|
+
*
|
|
17
|
+
* @docGroup
|
|
18
|
+
*
|
|
19
|
+
* 3. Caching options
|
|
20
|
+
*/
|
|
21
|
+
fetchPolicy?: WatchQueryFetchPolicy;
|
|
22
|
+
/**
|
|
23
|
+
* Specifies the `FetchPolicy` to be used after this query has completed.
|
|
24
|
+
*
|
|
25
|
+
* @docGroup
|
|
26
|
+
*
|
|
27
|
+
* 3. Caching options
|
|
28
|
+
*/
|
|
29
|
+
nextFetchPolicy?: WatchQueryFetchPolicy | ((this: WatchQueryOptions<TVariables, TData>, currentFetchPolicy: WatchQueryFetchPolicy, context: NextFetchPolicyContext<TData, TVariables>) => WatchQueryFetchPolicy);
|
|
30
|
+
/**
|
|
31
|
+
* 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.
|
|
32
|
+
*
|
|
33
|
+
* @docGroup
|
|
34
|
+
*
|
|
35
|
+
* 3. Caching options
|
|
36
|
+
*/
|
|
37
|
+
refetchWritePolicy?: RefetchWritePolicy;
|
|
38
|
+
/**
|
|
39
|
+
* Specifies how the query handles a response that returns both GraphQL errors and partial results.
|
|
40
|
+
*
|
|
41
|
+
* For details, see [GraphQL error policies](https://www.apollographql.com/docs/react/data/error-handling/#graphql-error-policies).
|
|
42
|
+
*
|
|
43
|
+
* The default value is `none`, meaning that the query result includes error details but not partial results.
|
|
44
|
+
*
|
|
45
|
+
* @docGroup
|
|
46
|
+
*
|
|
47
|
+
* 1. Operation options
|
|
48
|
+
*/
|
|
49
|
+
errorPolicy?: ErrorPolicy;
|
|
50
|
+
/**
|
|
51
|
+
* Specifies the interval (in milliseconds) at which the query polls for updated results.
|
|
52
|
+
*
|
|
53
|
+
* The default value is `0` (no polling).
|
|
54
|
+
*
|
|
55
|
+
* @docGroup
|
|
56
|
+
*
|
|
57
|
+
* 2. Networking options
|
|
58
|
+
*/
|
|
59
|
+
pollInterval?: number;
|
|
60
|
+
/**
|
|
61
|
+
* If `true`, the in-progress query's associated component re-renders whenever the network status changes or a network error occurs.
|
|
62
|
+
*
|
|
63
|
+
* The default value is `false`.
|
|
64
|
+
*
|
|
65
|
+
* @docGroup
|
|
66
|
+
*
|
|
67
|
+
* 2. Networking options
|
|
68
|
+
*/
|
|
69
|
+
notifyOnNetworkStatusChange?: boolean;
|
|
70
|
+
/**
|
|
71
|
+
* If `true`, the query can return partial results from the cache if the cache doesn't contain results for all queried fields.
|
|
72
|
+
*
|
|
73
|
+
* The default value is `false`.
|
|
74
|
+
*
|
|
75
|
+
* @docGroup
|
|
76
|
+
*
|
|
77
|
+
* 3. Caching options
|
|
78
|
+
*/
|
|
79
|
+
returnPartialData?: boolean;
|
|
80
|
+
/**
|
|
81
|
+
* 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.
|
|
82
|
+
*
|
|
83
|
+
* @docGroup
|
|
84
|
+
*
|
|
85
|
+
* 2. Networking options
|
|
86
|
+
*/
|
|
87
|
+
skipPollAttempt?: () => boolean;
|
|
88
|
+
/**
|
|
89
|
+
* The instance of `ApolloClient` to use to execute the query.
|
|
90
|
+
*
|
|
91
|
+
* By default, the instance that's passed down via context is used, but you can provide a different instance here.
|
|
92
|
+
*
|
|
93
|
+
* @docGroup
|
|
94
|
+
*
|
|
95
|
+
* 1. Operation options
|
|
96
|
+
*/
|
|
97
|
+
client?: ApolloClient;
|
|
98
|
+
/**
|
|
99
|
+
* 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.
|
|
100
|
+
*
|
|
101
|
+
* @docGroup
|
|
102
|
+
*
|
|
103
|
+
* 2. Networking options
|
|
104
|
+
*/
|
|
105
|
+
context?: DefaultContext;
|
|
106
|
+
}
|
|
107
|
+
interface Result<TData, TVariables extends OperationVariables> {
|
|
108
|
+
/**
|
|
109
|
+
* A function that instructs the query to begin re-executing at a specified interval (in milliseconds).
|
|
110
|
+
*
|
|
111
|
+
*
|
|
112
|
+
* @docGroup
|
|
113
|
+
*
|
|
114
|
+
* 3. Helper functions
|
|
115
|
+
*/
|
|
116
|
+
startPolling: (pollInterval: number) => void;
|
|
117
|
+
/**
|
|
118
|
+
* A function that instructs the query to stop polling after a previous call to `startPolling`.
|
|
119
|
+
*
|
|
120
|
+
*
|
|
121
|
+
* @docGroup
|
|
122
|
+
*
|
|
123
|
+
* 3. Helper functions
|
|
124
|
+
*/
|
|
125
|
+
stopPolling: () => void;
|
|
126
|
+
/**
|
|
127
|
+
* A function that enables you to execute a [subscription](https://www.apollographql.com/docs/react/data/subscriptions/), usually to subscribe to specific fields that were included in the query.
|
|
128
|
+
*
|
|
129
|
+
* This function returns _another_ function that you can call to terminate the subscription.
|
|
130
|
+
*
|
|
131
|
+
*
|
|
132
|
+
* @docGroup
|
|
133
|
+
*
|
|
134
|
+
* 3. Helper functions
|
|
135
|
+
*/
|
|
136
|
+
subscribeToMore: SubscribeToMoreFunction<TData, TVariables>;
|
|
137
|
+
/**
|
|
138
|
+
* A function that enables you to update the query's cached result without executing a followup GraphQL operation.
|
|
139
|
+
*
|
|
140
|
+
* See [using updateQuery and updateFragment](https://www.apollographql.com/docs/react/caching/cache-interaction/#using-updatequery-and-updatefragment) for additional information.
|
|
141
|
+
*
|
|
142
|
+
*
|
|
143
|
+
* @docGroup
|
|
144
|
+
*
|
|
145
|
+
* 3. Helper functions
|
|
146
|
+
*/
|
|
147
|
+
updateQuery: (mapFn: UpdateQueryMapFn<TData, TVariables>) => void;
|
|
148
|
+
/**
|
|
149
|
+
* A function that enables you to re-execute the query, optionally passing in new `variables`.
|
|
150
|
+
*
|
|
151
|
+
* To guarantee that the refetch performs a network request, its `fetchPolicy` is set to `network-only` (unless the original query's `fetchPolicy` is `no-cache` or `cache-and-network`, which also guarantee a network request).
|
|
152
|
+
*
|
|
153
|
+
* See also [Refetching](https://www.apollographql.com/docs/react/data/queries/#refetching).
|
|
154
|
+
*
|
|
155
|
+
* @docGroup
|
|
156
|
+
*
|
|
157
|
+
* 3. Helper functions
|
|
158
|
+
*/
|
|
159
|
+
refetch: (variables?: Partial<TVariables>) => Promise<ApolloQueryResult<MaybeMasked<TData>>>;
|
|
160
|
+
/**
|
|
161
|
+
* An object containing the variables that were provided for the query.
|
|
162
|
+
*
|
|
163
|
+
* @docGroup
|
|
164
|
+
*
|
|
165
|
+
* 1. Operation data
|
|
166
|
+
*/
|
|
167
|
+
variables: TVariables | undefined;
|
|
168
|
+
/**
|
|
169
|
+
* A function that helps you fetch the next set of results for a [paginated list field](https://www.apollographql.com/docs/react/pagination/core-api/).
|
|
170
|
+
*
|
|
171
|
+
*
|
|
172
|
+
* @docGroup
|
|
173
|
+
*
|
|
174
|
+
* 3. Helper functions
|
|
175
|
+
*/
|
|
176
|
+
fetchMore: <TFetchData = TData, TFetchVars extends OperationVariables = TVariables>(fetchMoreOptions: FetchMoreQueryOptions<TFetchVars, TFetchData> & {
|
|
177
|
+
updateQuery?: (previousQueryResult: Unmasked<TData>, options: {
|
|
178
|
+
fetchMoreResult: Unmasked<TFetchData>;
|
|
179
|
+
variables: TFetchVars;
|
|
180
|
+
}) => Unmasked<TData>;
|
|
181
|
+
}) => Promise<ApolloQueryResult<MaybeMasked<TFetchData>>>;
|
|
182
|
+
/**
|
|
183
|
+
* The instance of Apollo Client that executed the query. Can be useful for manually executing followup queries or writing data to the cache.
|
|
184
|
+
*
|
|
185
|
+
* @docGroup
|
|
186
|
+
*
|
|
187
|
+
* 2. Network info
|
|
188
|
+
*/
|
|
189
|
+
client: ApolloClient;
|
|
190
|
+
/**
|
|
191
|
+
* A reference to the internal `ObservableQuery` used by the hook.
|
|
192
|
+
*/
|
|
193
|
+
observable: ObservableQuery<TData, TVariables>;
|
|
194
|
+
/**
|
|
195
|
+
* An object containing the result of your GraphQL query after it completes.
|
|
196
|
+
*
|
|
197
|
+
* This value might be `undefined` if a query results in one or more errors (depending on the query's `errorPolicy`).
|
|
198
|
+
*
|
|
199
|
+
* @docGroup
|
|
200
|
+
*
|
|
201
|
+
* 1. Operation data
|
|
202
|
+
*/
|
|
203
|
+
data: MaybeMasked<TData> | undefined;
|
|
204
|
+
/**
|
|
205
|
+
* An object containing the result from the most recent _previous_ execution of this query.
|
|
206
|
+
*
|
|
207
|
+
* This value is `undefined` if this is the query's first execution.
|
|
208
|
+
*
|
|
209
|
+
* @docGroup
|
|
210
|
+
*
|
|
211
|
+
* 1. Operation data
|
|
212
|
+
*/
|
|
213
|
+
previousData?: MaybeMasked<TData>;
|
|
214
|
+
/**
|
|
215
|
+
* If the query produces one or more errors, this object contains either an array of `graphQLErrors` or a single `networkError`. Otherwise, this value is `undefined`.
|
|
216
|
+
*
|
|
217
|
+
* For more information, see [Handling operation errors](https://www.apollographql.com/docs/react/data/error-handling/).
|
|
218
|
+
*
|
|
219
|
+
* @docGroup
|
|
220
|
+
*
|
|
221
|
+
* 1. Operation data
|
|
222
|
+
*/
|
|
223
|
+
error?: ErrorLike;
|
|
224
|
+
/**
|
|
225
|
+
* If `true`, the query is still in flight and results have not yet been returned.
|
|
226
|
+
*
|
|
227
|
+
* @docGroup
|
|
228
|
+
*
|
|
229
|
+
* 2. Network info
|
|
230
|
+
*/
|
|
231
|
+
loading: boolean;
|
|
232
|
+
/**
|
|
233
|
+
* A number indicating the current network state of the query's associated request. [See possible values.](https://github.com/apollographql/apollo-client/blob/d96f4578f89b933c281bb775a39503f6cdb59ee8/src/core/networkStatus.ts#L4)
|
|
234
|
+
*
|
|
235
|
+
* Used in conjunction with the [`notifyOnNetworkStatusChange`](#notifyonnetworkstatuschange) option.
|
|
236
|
+
*
|
|
237
|
+
* @docGroup
|
|
238
|
+
*
|
|
239
|
+
* 2. Network info
|
|
240
|
+
*/
|
|
241
|
+
networkStatus: NetworkStatus;
|
|
242
|
+
/**
|
|
243
|
+
* If `true`, the associated lazy query has been executed.
|
|
244
|
+
*
|
|
245
|
+
* @docGroup 2. Network info
|
|
246
|
+
*/
|
|
247
|
+
called: boolean;
|
|
248
|
+
}
|
|
249
|
+
type ExecOptions<TVariables extends OperationVariables = OperationVariables> = {
|
|
250
|
+
/**
|
|
251
|
+
* 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.
|
|
252
|
+
*
|
|
253
|
+
* @docGroup
|
|
254
|
+
*
|
|
255
|
+
* 2. Networking options
|
|
256
|
+
*/
|
|
257
|
+
context?: DefaultContext;
|
|
258
|
+
} & VariablesOption<TVariables>;
|
|
259
|
+
type ResultTuple<TData, TVariables extends OperationVariables> = [
|
|
260
|
+
execute: ExecFunction<TData, TVariables>,
|
|
261
|
+
result: useLazyQuery.Result<TData, TVariables>
|
|
262
|
+
];
|
|
263
|
+
type ExecFunction<TData, TVariables extends OperationVariables> = (...args: [TVariables] extends [never] ? [
|
|
264
|
+
options?: useLazyQuery.ExecOptions<TVariables>
|
|
265
|
+
] : Record<string, never> extends OnlyRequiredProperties<TVariables> ? [
|
|
266
|
+
options?: useLazyQuery.ExecOptions<TVariables>
|
|
267
|
+
] : [options: useLazyQuery.ExecOptions<TVariables>]) => Promise<ApolloQueryResult<TData>>;
|
|
106
268
|
}
|
|
107
|
-
export type LazyQueryHookExecOptions<TVariables extends OperationVariables = OperationVariables> = {
|
|
108
|
-
/**
|
|
109
|
-
* 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.
|
|
110
|
-
*
|
|
111
|
-
* @docGroup
|
|
112
|
-
*
|
|
113
|
-
* 2. Networking options
|
|
114
|
-
*/
|
|
115
|
-
context?: DefaultContext;
|
|
116
|
-
} & VariablesOption<TVariables>;
|
|
117
|
-
export interface LazyQueryResult<TData, TVariables extends OperationVariables> {
|
|
118
|
-
/**
|
|
119
|
-
* A function that instructs the query to begin re-executing at a specified interval (in milliseconds).
|
|
120
|
-
*
|
|
121
|
-
*
|
|
122
|
-
* @docGroup
|
|
123
|
-
*
|
|
124
|
-
* 3. Helper functions
|
|
125
|
-
*/
|
|
126
|
-
startPolling: (pollInterval: number) => void;
|
|
127
|
-
/**
|
|
128
|
-
* A function that instructs the query to stop polling after a previous call to `startPolling`.
|
|
129
|
-
*
|
|
130
|
-
*
|
|
131
|
-
* @docGroup
|
|
132
|
-
*
|
|
133
|
-
* 3. Helper functions
|
|
134
|
-
*/
|
|
135
|
-
stopPolling: () => void;
|
|
136
|
-
/**
|
|
137
|
-
* A function that enables you to execute a [subscription](https://www.apollographql.com/docs/react/data/subscriptions/), usually to subscribe to specific fields that were included in the query.
|
|
138
|
-
*
|
|
139
|
-
* This function returns _another_ function that you can call to terminate the subscription.
|
|
140
|
-
*
|
|
141
|
-
*
|
|
142
|
-
* @docGroup
|
|
143
|
-
*
|
|
144
|
-
* 3. Helper functions
|
|
145
|
-
*/
|
|
146
|
-
subscribeToMore: SubscribeToMoreFunction<TData, TVariables>;
|
|
147
|
-
/**
|
|
148
|
-
* A function that enables you to update the query's cached result without executing a followup GraphQL operation.
|
|
149
|
-
*
|
|
150
|
-
* See [using updateQuery and updateFragment](https://www.apollographql.com/docs/react/caching/cache-interaction/#using-updatequery-and-updatefragment) for additional information.
|
|
151
|
-
*
|
|
152
|
-
*
|
|
153
|
-
* @docGroup
|
|
154
|
-
*
|
|
155
|
-
* 3. Helper functions
|
|
156
|
-
*/
|
|
157
|
-
updateQuery: (mapFn: UpdateQueryMapFn<TData, TVariables>) => void;
|
|
158
|
-
/**
|
|
159
|
-
* A function that enables you to re-execute the query, optionally passing in new `variables`.
|
|
160
|
-
*
|
|
161
|
-
* To guarantee that the refetch performs a network request, its `fetchPolicy` is set to `network-only` (unless the original query's `fetchPolicy` is `no-cache` or `cache-and-network`, which also guarantee a network request).
|
|
162
|
-
*
|
|
163
|
-
* See also [Refetching](https://www.apollographql.com/docs/react/data/queries/#refetching).
|
|
164
|
-
*
|
|
165
|
-
* @docGroup
|
|
166
|
-
*
|
|
167
|
-
* 3. Helper functions
|
|
168
|
-
*/
|
|
169
|
-
refetch: (variables?: Partial<TVariables>) => Promise<ApolloQueryResult<MaybeMasked<TData>>>;
|
|
170
|
-
/**
|
|
171
|
-
* An object containing the variables that were provided for the query.
|
|
172
|
-
*
|
|
173
|
-
* @docGroup
|
|
174
|
-
*
|
|
175
|
-
* 1. Operation data
|
|
176
|
-
*/
|
|
177
|
-
variables: TVariables | undefined;
|
|
178
|
-
/**
|
|
179
|
-
* A function that helps you fetch the next set of results for a [paginated list field](https://www.apollographql.com/docs/react/pagination/core-api/).
|
|
180
|
-
*
|
|
181
|
-
*
|
|
182
|
-
* @docGroup
|
|
183
|
-
*
|
|
184
|
-
* 3. Helper functions
|
|
185
|
-
*/
|
|
186
|
-
fetchMore: <TFetchData = TData, TFetchVars extends OperationVariables = TVariables>(fetchMoreOptions: FetchMoreQueryOptions<TFetchVars, TFetchData> & {
|
|
187
|
-
updateQuery?: (previousQueryResult: Unmasked<TData>, options: {
|
|
188
|
-
fetchMoreResult: Unmasked<TFetchData>;
|
|
189
|
-
variables: TFetchVars;
|
|
190
|
-
}) => Unmasked<TData>;
|
|
191
|
-
}) => Promise<ApolloQueryResult<MaybeMasked<TFetchData>>>;
|
|
192
|
-
/**
|
|
193
|
-
* The instance of Apollo Client that executed the query. Can be useful for manually executing followup queries or writing data to the cache.
|
|
194
|
-
*
|
|
195
|
-
* @docGroup
|
|
196
|
-
*
|
|
197
|
-
* 2. Network info
|
|
198
|
-
*/
|
|
199
|
-
client: ApolloClient;
|
|
200
|
-
/**
|
|
201
|
-
* A reference to the internal `ObservableQuery` used by the hook.
|
|
202
|
-
*/
|
|
203
|
-
observable: ObservableQuery<TData, TVariables>;
|
|
204
|
-
/**
|
|
205
|
-
* An object containing the result of your GraphQL query after it completes.
|
|
206
|
-
*
|
|
207
|
-
* This value might be `undefined` if a query results in one or more errors (depending on the query's `errorPolicy`).
|
|
208
|
-
*
|
|
209
|
-
* @docGroup
|
|
210
|
-
*
|
|
211
|
-
* 1. Operation data
|
|
212
|
-
*/
|
|
213
|
-
data: MaybeMasked<TData> | undefined;
|
|
214
|
-
/**
|
|
215
|
-
* An object containing the result from the most recent _previous_ execution of this query.
|
|
216
|
-
*
|
|
217
|
-
* This value is `undefined` if this is the query's first execution.
|
|
218
|
-
*
|
|
219
|
-
* @docGroup
|
|
220
|
-
*
|
|
221
|
-
* 1. Operation data
|
|
222
|
-
*/
|
|
223
|
-
previousData?: MaybeMasked<TData>;
|
|
224
|
-
/**
|
|
225
|
-
* If the query produces one or more errors, this object contains either an array of `graphQLErrors` or a single `networkError`. Otherwise, this value is `undefined`.
|
|
226
|
-
*
|
|
227
|
-
* For more information, see [Handling operation errors](https://www.apollographql.com/docs/react/data/error-handling/).
|
|
228
|
-
*
|
|
229
|
-
* @docGroup
|
|
230
|
-
*
|
|
231
|
-
* 1. Operation data
|
|
232
|
-
*/
|
|
233
|
-
error?: ErrorLike;
|
|
234
|
-
/**
|
|
235
|
-
* If `true`, the query is still in flight and results have not yet been returned.
|
|
236
|
-
*
|
|
237
|
-
* @docGroup
|
|
238
|
-
*
|
|
239
|
-
* 2. Network info
|
|
240
|
-
*/
|
|
241
|
-
loading: boolean;
|
|
242
|
-
/**
|
|
243
|
-
* A number indicating the current network state of the query's associated request. [See possible values.](https://github.com/apollographql/apollo-client/blob/d96f4578f89b933c281bb775a39503f6cdb59ee8/src/core/networkStatus.ts#L4)
|
|
244
|
-
*
|
|
245
|
-
* Used in conjunction with the [`notifyOnNetworkStatusChange`](#notifyonnetworkstatuschange) option.
|
|
246
|
-
*
|
|
247
|
-
* @docGroup
|
|
248
|
-
*
|
|
249
|
-
* 2. Network info
|
|
250
|
-
*/
|
|
251
|
-
networkStatus: NetworkStatus;
|
|
252
|
-
/**
|
|
253
|
-
* If `true`, the associated lazy query has been executed.
|
|
254
|
-
*
|
|
255
|
-
* This field is only present on the result object returned by [`useLazyQuery`](/react/data/queries/#executing-queries-manually).
|
|
256
|
-
*
|
|
257
|
-
* @docGroup
|
|
258
|
-
*
|
|
259
|
-
* 2. Network info
|
|
260
|
-
*/
|
|
261
|
-
called: boolean;
|
|
262
|
-
}
|
|
263
|
-
export type LazyQueryResultTuple<TData, TVariables extends OperationVariables> = [
|
|
264
|
-
execute: LazyQueryExecFunction<TData, TVariables>,
|
|
265
|
-
result: LazyQueryResult<TData, TVariables>
|
|
266
|
-
];
|
|
267
|
-
export type LazyQueryExecFunction<TData, TVariables extends OperationVariables> = (...args: [TVariables] extends [never] ? [
|
|
268
|
-
options?: LazyQueryHookExecOptions<TVariables>
|
|
269
|
-
] : Record<string, never> extends OnlyRequiredProperties<TVariables> ? [
|
|
270
|
-
options?: LazyQueryHookExecOptions<TVariables>
|
|
271
|
-
] : [options: LazyQueryHookExecOptions<TVariables>]) => Promise<ApolloQueryResult<TData>>;
|
|
272
269
|
/**
|
|
273
270
|
* A hook for imperatively executing queries in an Apollo application, e.g. in response to user interaction.
|
|
274
271
|
*
|
|
@@ -304,5 +301,5 @@ export type LazyQueryExecFunction<TData, TVariables extends OperationVariables>
|
|
|
304
301
|
* @param options - Default options to control how the query is executed.
|
|
305
302
|
* @returns A tuple in the form of `[execute, result]`
|
|
306
303
|
*/
|
|
307
|
-
export declare function useLazyQuery<TData = unknown, TVariables extends OperationVariables = OperationVariables>(query: DocumentNode | TypedDocumentNode<TData, TVariables>, options?:
|
|
304
|
+
export declare function useLazyQuery<TData = unknown, TVariables extends OperationVariables = OperationVariables>(query: DocumentNode | TypedDocumentNode<TData, TVariables>, options?: useLazyQuery.Options<NoInfer<TData>, NoInfer<TVariables>>): useLazyQuery.ResultTuple<TData, TVariables>;
|
|
308
305
|
//# sourceMappingURL=useLazyQuery.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLoadableQuery.cjs","sources":["../../../../src/react/hooks/useLoadableQuery.ts"],"sourcesContent":["import * as React from \"react\";\n\nimport { canonicalStringify } from \"@apollo/client/cache\";\nimport type {\n DocumentNode,\n FetchMoreQueryOptions,\n OperationVariables,\n TypedDocumentNode,\n WatchQueryOptions,\n} from \"@apollo/client/core\";\nimport type {\n SubscribeToMoreFunction,\n SubscribeToMoreOptions,\n} from \"@apollo/client/core\";\nimport type { LoadableQueryHookOptions } from \"@apollo/client/react\";\nimport type { CacheKey, QueryRef } from \"@apollo/client/react/internal\";\nimport {\n assertWrappedQueryRef,\n getSuspenseCache,\n unwrapQueryRef,\n updateWrappedQueryRef,\n wrapQueryRef,\n} from \"@apollo/client/react/internal\";\nimport type {\n DeepPartial,\n OnlyRequiredProperties,\n} from \"@apollo/client/utilities\";\nimport { invariant } from \"@apollo/client/utilities/invariant\";\n\nimport { __use, useRenderGuard } from \"./internal/index.js\";\nimport { useApolloClient } from \"./useApolloClient.js\";\nimport type { FetchMoreFunction, RefetchFunction } from \"./useSuspenseQuery.js\";\nimport { useWatchQueryOptions } from \"./useSuspenseQuery.js\";\n\nexport type LoadQueryFunction<TVariables extends OperationVariables> = (\n // Use variadic args to handle cases where TVariables is type `never`, in\n // which case we don't want to allow a variables argument. In other\n // words, we don't want to allow variables to be passed as an argument to this\n // function if the query does not expect variables in the document.\n ...args: [TVariables] extends [never] ? []\n : {} extends OnlyRequiredProperties<TVariables> ? [variables?: TVariables]\n : [variables: TVariables]\n) => void;\n\ntype ResetFunction = () => void;\n\nexport type UseLoadableQueryResult<\n TData = unknown,\n TVariables extends OperationVariables = OperationVariables,\n> = [\n loadQuery: LoadQueryFunction<TVariables>,\n queryRef: QueryRef<TData, TVariables> | null,\n handlers: {\n /** {@inheritDoc @apollo/client!QueryResultDocumentation#fetchMore:member} */\n fetchMore: FetchMoreFunction<TData, TVariables>;\n /** {@inheritDoc @apollo/client!QueryResultDocumentation#refetch:member} */\n refetch: RefetchFunction<TData, TVariables>;\n /** {@inheritDoc @apollo/client!ObservableQuery#subscribeToMore:member(1)} */\n subscribeToMore: SubscribeToMoreFunction<TData, TVariables>;\n /**\n * A function that resets the `queryRef` back to `null`.\n */\n reset: ResetFunction;\n },\n];\n\nexport function useLoadableQuery<\n TData,\n TVariables extends OperationVariables,\n TOptions extends LoadableQueryHookOptions,\n>(\n query: DocumentNode | TypedDocumentNode<TData, TVariables>,\n options?: LoadableQueryHookOptions & TOptions\n): UseLoadableQueryResult<\n TOptions[\"errorPolicy\"] extends \"ignore\" | \"all\" ?\n TOptions[\"returnPartialData\"] extends true ?\n DeepPartial<TData> | undefined\n : TData | undefined\n : TOptions[\"returnPartialData\"] extends true ? DeepPartial<TData>\n : TData,\n TVariables\n>;\n\nexport function useLoadableQuery<\n TData = unknown,\n TVariables extends OperationVariables = OperationVariables,\n>(\n query: DocumentNode | TypedDocumentNode<TData, TVariables>,\n options: LoadableQueryHookOptions & {\n returnPartialData: true;\n errorPolicy: \"ignore\" | \"all\";\n }\n): UseLoadableQueryResult<DeepPartial<TData> | undefined, TVariables>;\n\nexport function useLoadableQuery<\n TData = unknown,\n TVariables extends OperationVariables = OperationVariables,\n>(\n query: DocumentNode | TypedDocumentNode<TData, TVariables>,\n options: LoadableQueryHookOptions & {\n errorPolicy: \"ignore\" | \"all\";\n }\n): UseLoadableQueryResult<TData | undefined, TVariables>;\n\nexport function useLoadableQuery<\n TData = unknown,\n TVariables extends OperationVariables = OperationVariables,\n>(\n query: DocumentNode | TypedDocumentNode<TData, TVariables>,\n options: LoadableQueryHookOptions & {\n returnPartialData: true;\n }\n): UseLoadableQueryResult<DeepPartial<TData>, TVariables>;\n\n/**\n * A hook for imperatively loading a query, such as responding to a user\n * interaction.\n *\n * > Refer to the [Suspense - Fetching in response to user interaction](https://www.apollographql.com/docs/react/data/suspense#fetching-in-response-to-user-interaction) section for a more in-depth overview of `useLoadableQuery`.\n *\n * @example\n * ```jsx\n * import { gql, useLoadableQuery } from \"@apollo/client\";\n *\n * const GET_GREETING = gql`\n * query GetGreeting($language: String!) {\n * greeting(language: $language) {\n * message\n * }\n * }\n * `;\n *\n * function App() {\n * const [loadGreeting, queryRef] = useLoadableQuery(GET_GREETING);\n *\n * return (\n * <>\n * <button onClick={() => loadGreeting({ language: \"english\" })}>\n * Load greeting\n * </button>\n * <Suspense fallback={<div>Loading...</div>}>\n * {queryRef && <Hello queryRef={queryRef} />}\n * </Suspense>\n * </>\n * );\n * }\n *\n * function Hello({ queryRef }) {\n * const { data } = useReadQuery(queryRef);\n *\n * return <div>{data.greeting.message}</div>;\n * }\n * ```\n *\n * @since 3.9.0\n * @param query - A GraphQL query document parsed into an AST by `gql`.\n * @param options - Options to control how the query is executed.\n * @returns A tuple in the form of `[loadQuery, queryRef, handlers]`\n */\nexport function useLoadableQuery<\n TData = unknown,\n TVariables extends OperationVariables = OperationVariables,\n>(\n query: DocumentNode | TypedDocumentNode<TData, TVariables>,\n options?: LoadableQueryHookOptions\n): UseLoadableQueryResult<TData, TVariables>;\n\nexport function useLoadableQuery<\n TData = unknown,\n TVariables extends OperationVariables = OperationVariables,\n>(\n query: DocumentNode | TypedDocumentNode<TData, TVariables>,\n options: LoadableQueryHookOptions = {}\n): UseLoadableQueryResult<TData, TVariables> {\n const client = useApolloClient(options.client);\n const suspenseCache = getSuspenseCache(client);\n const watchQueryOptions = useWatchQueryOptions({ client, query, options });\n const { queryKey = [] } = options;\n\n const [queryRef, setQueryRef] = React.useState<QueryRef<\n TData,\n TVariables\n > | null>(null);\n\n assertWrappedQueryRef(queryRef);\n\n const internalQueryRef = queryRef && unwrapQueryRef(queryRef);\n\n if (queryRef && internalQueryRef?.didChangeOptions(watchQueryOptions)) {\n const promise = internalQueryRef.applyOptions(watchQueryOptions);\n updateWrappedQueryRef(queryRef, promise);\n }\n\n const calledDuringRender = useRenderGuard();\n\n const fetchMore: FetchMoreFunction<TData, TVariables> = React.useCallback(\n (options) => {\n if (!internalQueryRef) {\n throw new Error(\n \"The query has not been loaded. Please load the query.\"\n );\n }\n\n const promise = internalQueryRef.fetchMore(\n options as FetchMoreQueryOptions<TVariables, TData>\n );\n\n setQueryRef(wrapQueryRef(internalQueryRef));\n\n return promise;\n },\n [internalQueryRef]\n );\n\n const refetch: RefetchFunction<TData, TVariables> = React.useCallback(\n (options) => {\n if (!internalQueryRef) {\n throw new Error(\n \"The query has not been loaded. Please load the query.\"\n );\n }\n\n const promise = internalQueryRef.refetch(options);\n\n setQueryRef(wrapQueryRef(internalQueryRef));\n\n return promise;\n },\n [internalQueryRef]\n );\n\n const loadQuery: LoadQueryFunction<TVariables> = React.useCallback(\n (...args) => {\n invariant(\n !calledDuringRender(),\n \"useLoadableQuery: 'loadQuery' should not be called during render. To start a query during render, use the 'useBackgroundQuery' hook.\"\n );\n\n const [variables] = args;\n\n const cacheKey: CacheKey = [\n query,\n canonicalStringify(variables),\n ...([] as any[]).concat(queryKey),\n ];\n\n const queryRef = suspenseCache.getQueryRef(cacheKey, () =>\n client.watchQuery({\n ...watchQueryOptions,\n variables,\n } as WatchQueryOptions<any, any>)\n );\n\n setQueryRef(wrapQueryRef(queryRef));\n },\n [\n query,\n queryKey,\n suspenseCache,\n watchQueryOptions,\n calledDuringRender,\n client,\n ]\n );\n\n const subscribeToMore: SubscribeToMoreFunction<TData, TVariables> =\n React.useCallback(\n (options) => {\n invariant(\n internalQueryRef,\n \"The query has not been loaded. Please load the query.\"\n );\n\n return internalQueryRef.observable.subscribeToMore(\n // TODO: The internalQueryRef doesn't have TVariables' type information so we have to cast it here\n options as any as SubscribeToMoreOptions<TData, OperationVariables>\n );\n },\n [internalQueryRef]\n );\n\n const reset: ResetFunction = React.useCallback(() => {\n setQueryRef(null);\n }, []);\n\n return [loadQuery, queryRef, { fetchMore, refetch, reset, subscribeToMore }];\n}\n"],"names":[],"mappings":";;AAuKA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;;AAvKA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAEA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CA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CAAA,CAAA,CAA6E,CACpE;IACH,CAAC,EACD,CAAC,CADP,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CACuB,CAAC,CACnB;IAEH,CAAF,CAAA,CAAA,CAAA,EAAQ,CAAR,CAAA,CAAA,CAAA,EAAA,EAA+B,CAA/B,CAAA,CAAA,CAAA,CAAoC,CAAC,CAArC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAgD,CAAC,CAAjD,EAAoD,CAApD,EAAA;QACI,CAAJ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAe,CAAC,CAAhB,CAAA,CAAA,CAAoB,CAAC;IACnB,CAAC,EAAE,CAAL,CAAO,CAAC;IAEN,CAAF,CAAA,CAAA,CAAA,CAAA,EAAS,CAAC,CAAV,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAmB,EAAE,CAArB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAA6B,EAAE,EAAE,CAAjC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAA0C,EAAE,CAA5C,CAAA,CAAA,CAAA,CAAA,CAAA,CAAmD,EAAE,CAArD,CAAA,CAAA,CAAA,CAA0D,EAAE,CAA5D,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAA6E,CAAC;AAC9E;"}
|
|
1
|
+
{"version":3,"file":"useLoadableQuery.cjs","sources":["../../../../src/react/hooks/useLoadableQuery.ts"],"sourcesContent":["import * as React from \"react\";\n\nimport { canonicalStringify } from \"@apollo/client/cache\";\nimport type {\n ApolloClient,\n DefaultContext,\n DocumentNode,\n ErrorPolicy,\n FetchMoreQueryOptions,\n OperationVariables,\n RefetchWritePolicy,\n TypedDocumentNode,\n WatchQueryFetchPolicy,\n WatchQueryOptions,\n} from \"@apollo/client/core\";\nimport type {\n SubscribeToMoreFunction,\n SubscribeToMoreOptions,\n} from \"@apollo/client/core\";\nimport type {\n CacheKey,\n FetchMoreFunction,\n QueryRef,\n RefetchFunction,\n} from \"@apollo/client/react/internal\";\nimport {\n assertWrappedQueryRef,\n getSuspenseCache,\n unwrapQueryRef,\n updateWrappedQueryRef,\n wrapQueryRef,\n} from \"@apollo/client/react/internal\";\nimport type {\n DeepPartial,\n OnlyRequiredProperties,\n} from \"@apollo/client/utilities\";\nimport { invariant } from \"@apollo/client/utilities/invariant\";\n\nimport { __use, useRenderGuard } from \"./internal/index.js\";\nimport { useApolloClient } from \"./useApolloClient.js\";\nimport { useWatchQueryOptions } from \"./useSuspenseQuery.js\";\n\ntype ResetFunction = () => void;\n\nexport declare namespace useLoadableQuery {\n export type LoadQueryFunction<TVariables extends OperationVariables> = (\n // Use variadic args to handle cases where TVariables is type `never`, in\n // which case we don't want to allow a variables argument. In other\n // words, we don't want to allow variables to be passed as an argument to this\n // function if the query does not expect variables in the document.\n ...args: [TVariables] extends [never] ? []\n : {} extends OnlyRequiredProperties<TVariables> ? [variables?: TVariables]\n : [variables: TVariables]\n ) => void;\n\n export type Result<\n TData = unknown,\n TVariables extends OperationVariables = OperationVariables,\n > = [\n loadQuery: LoadQueryFunction<TVariables>,\n queryRef: QueryRef<TData, TVariables> | null,\n handlers: {\n /** {@inheritDoc @apollo/client!QueryResultDocumentation#fetchMore:member} */\n fetchMore: FetchMoreFunction<TData, TVariables>;\n /** {@inheritDoc @apollo/client!QueryResultDocumentation#refetch:member} */\n refetch: RefetchFunction<TData, TVariables>;\n /** {@inheritDoc @apollo/client!ObservableQuery#subscribeToMore:member(1)} */\n subscribeToMore: SubscribeToMoreFunction<TData, TVariables>;\n /**\n * A function that resets the `queryRef` back to `null`.\n */\n reset: ResetFunction;\n },\n ];\n\n export type FetchPolicy = Extract<\n WatchQueryFetchPolicy,\n \"cache-first\" | \"network-only\" | \"no-cache\" | \"cache-and-network\"\n >;\n\n export interface Options {\n /** {@inheritDoc @apollo/client!QueryOptionsDocumentation#client:member} */\n client?: ApolloClient;\n\n /** {@inheritDoc @apollo/client!QueryOptionsDocumentation#context:member} */\n context?: DefaultContext;\n\n /** {@inheritDoc @apollo/client!QueryOptionsDocumentation#errorPolicy:member} */\n errorPolicy?: ErrorPolicy;\n\n /** {@inheritDoc @apollo/client!QueryOptionsDocumentation#fetchPolicy:member} */\n fetchPolicy?: FetchPolicy;\n\n /** {@inheritDoc @apollo/client!QueryOptionsDocumentation#queryKey:member} */\n queryKey?: string | number | any[];\n\n /** {@inheritDoc @apollo/client!QueryOptionsDocumentation#refetchWritePolicy:member} */\n refetchWritePolicy?: RefetchWritePolicy;\n\n /** {@inheritDoc @apollo/client!QueryOptionsDocumentation#returnPartialData:member} */\n returnPartialData?: boolean;\n }\n}\n\nexport function useLoadableQuery<\n TData,\n TVariables extends OperationVariables,\n TOptions extends useLoadableQuery.Options,\n>(\n query: DocumentNode | TypedDocumentNode<TData, TVariables>,\n options?: useLoadableQuery.Options & TOptions\n): useLoadableQuery.Result<\n TOptions[\"errorPolicy\"] extends \"ignore\" | \"all\" ?\n TOptions[\"returnPartialData\"] extends true ?\n DeepPartial<TData> | undefined\n : TData | undefined\n : TOptions[\"returnPartialData\"] extends true ? DeepPartial<TData>\n : TData,\n TVariables\n>;\n\nexport function useLoadableQuery<\n TData = unknown,\n TVariables extends OperationVariables = OperationVariables,\n>(\n query: DocumentNode | TypedDocumentNode<TData, TVariables>,\n options: useLoadableQuery.Options & {\n returnPartialData: true;\n errorPolicy: \"ignore\" | \"all\";\n }\n): useLoadableQuery.Result<DeepPartial<TData> | undefined, TVariables>;\n\nexport function useLoadableQuery<\n TData = unknown,\n TVariables extends OperationVariables = OperationVariables,\n>(\n query: DocumentNode | TypedDocumentNode<TData, TVariables>,\n options: useLoadableQuery.Options & {\n errorPolicy: \"ignore\" | \"all\";\n }\n): useLoadableQuery.Result<TData | undefined, TVariables>;\n\nexport function useLoadableQuery<\n TData = unknown,\n TVariables extends OperationVariables = OperationVariables,\n>(\n query: DocumentNode | TypedDocumentNode<TData, TVariables>,\n options: useLoadableQuery.Options & {\n returnPartialData: true;\n }\n): useLoadableQuery.Result<DeepPartial<TData>, TVariables>;\n\n/**\n * A hook for imperatively loading a query, such as responding to a user\n * interaction.\n *\n * > Refer to the [Suspense - Fetching in response to user interaction](https://www.apollographql.com/docs/react/data/suspense#fetching-in-response-to-user-interaction) section for a more in-depth overview of `useLoadableQuery`.\n *\n * @example\n * ```jsx\n * import { gql, useLoadableQuery } from \"@apollo/client\";\n *\n * const GET_GREETING = gql`\n * query GetGreeting($language: String!) {\n * greeting(language: $language) {\n * message\n * }\n * }\n * `;\n *\n * function App() {\n * const [loadGreeting, queryRef] = useLoadableQuery(GET_GREETING);\n *\n * return (\n * <>\n * <button onClick={() => loadGreeting({ language: \"english\" })}>\n * Load greeting\n * </button>\n * <Suspense fallback={<div>Loading...</div>}>\n * {queryRef && <Hello queryRef={queryRef} />}\n * </Suspense>\n * </>\n * );\n * }\n *\n * function Hello({ queryRef }) {\n * const { data } = useReadQuery(queryRef);\n *\n * return <div>{data.greeting.message}</div>;\n * }\n * ```\n *\n * @since 3.9.0\n * @param query - A GraphQL query document parsed into an AST by `gql`.\n * @param options - Options to control how the query is executed.\n * @returns A tuple in the form of `[loadQuery, queryRef, handlers]`\n */\nexport function useLoadableQuery<\n TData = unknown,\n TVariables extends OperationVariables = OperationVariables,\n>(\n query: DocumentNode | TypedDocumentNode<TData, TVariables>,\n options?: useLoadableQuery.Options\n): useLoadableQuery.Result<TData, TVariables>;\n\nexport function useLoadableQuery<\n TData = unknown,\n TVariables extends OperationVariables = OperationVariables,\n>(\n query: DocumentNode | TypedDocumentNode<TData, TVariables>,\n options: useLoadableQuery.Options = {}\n): useLoadableQuery.Result<TData, TVariables> {\n const client = useApolloClient(options.client);\n const suspenseCache = getSuspenseCache(client);\n const watchQueryOptions = useWatchQueryOptions({ client, query, options });\n const { queryKey = [] } = options;\n\n const [queryRef, setQueryRef] = React.useState<QueryRef<\n TData,\n TVariables\n > | null>(null);\n\n assertWrappedQueryRef(queryRef);\n\n const internalQueryRef = queryRef && unwrapQueryRef(queryRef);\n\n if (queryRef && internalQueryRef?.didChangeOptions(watchQueryOptions)) {\n const promise = internalQueryRef.applyOptions(watchQueryOptions);\n updateWrappedQueryRef(queryRef, promise);\n }\n\n const calledDuringRender = useRenderGuard();\n\n const fetchMore: FetchMoreFunction<TData, TVariables> = React.useCallback(\n (options) => {\n if (!internalQueryRef) {\n throw new Error(\n \"The query has not been loaded. Please load the query.\"\n );\n }\n\n const promise = internalQueryRef.fetchMore(\n options as FetchMoreQueryOptions<TVariables, TData>\n );\n\n setQueryRef(wrapQueryRef(internalQueryRef));\n\n return promise;\n },\n [internalQueryRef]\n );\n\n const refetch: RefetchFunction<TData, TVariables> = React.useCallback(\n (options) => {\n if (!internalQueryRef) {\n throw new Error(\n \"The query has not been loaded. Please load the query.\"\n );\n }\n\n const promise = internalQueryRef.refetch(options);\n\n setQueryRef(wrapQueryRef(internalQueryRef));\n\n return promise;\n },\n [internalQueryRef]\n );\n\n const loadQuery: useLoadableQuery.LoadQueryFunction<TVariables> =\n React.useCallback(\n (...args) => {\n invariant(\n !calledDuringRender(),\n \"useLoadableQuery: 'loadQuery' should not be called during render. To start a query during render, use the 'useBackgroundQuery' hook.\"\n );\n\n const [variables] = args;\n\n const cacheKey: CacheKey = [\n query,\n canonicalStringify(variables),\n ...([] as any[]).concat(queryKey),\n ];\n\n const queryRef = suspenseCache.getQueryRef(cacheKey, () =>\n client.watchQuery({\n ...watchQueryOptions,\n variables,\n } as WatchQueryOptions<any, any>)\n );\n\n setQueryRef(wrapQueryRef(queryRef));\n },\n [\n query,\n queryKey,\n suspenseCache,\n watchQueryOptions,\n calledDuringRender,\n client,\n ]\n );\n\n const subscribeToMore: SubscribeToMoreFunction<TData, TVariables> =\n React.useCallback(\n (options) => {\n invariant(\n internalQueryRef,\n \"The query has not been loaded. Please load the query.\"\n );\n\n return internalQueryRef.observable.subscribeToMore(\n // TODO: The internalQueryRef doesn't have TVariables' type information so we have to cast it here\n options as any as SubscribeToMoreOptions<TData, OperationVariables>\n );\n },\n [internalQueryRef]\n );\n\n const reset: ResetFunction = React.useCallback(() => {\n setQueryRef(null);\n }, []);\n\n return [loadQuery, queryRef, { fetchMore, refetch, reset, subscribeToMore }];\n}\n"],"names":[],"mappings":";;AA6MA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;;AA7MA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAEA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAuBA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,C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