@apollo/client 4.0.0-rc.3 → 4.0.0-rc.5
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 +53 -0
- package/__cjs/cache/core/cache.cjs +2 -6
- package/__cjs/cache/core/cache.cjs.map +1 -1
- package/__cjs/cache/core/cache.d.cts +42 -13
- package/__cjs/cache/inmemory/entityStore.cjs +3 -3
- package/__cjs/cache/inmemory/entityStore.cjs.map +1 -1
- package/__cjs/cache/inmemory/entityStore.d.cts +1 -1
- package/__cjs/cache/inmemory/inMemoryCache.cjs +1 -1
- package/__cjs/cache/inmemory/inMemoryCache.cjs.map +1 -1
- package/__cjs/cache/inmemory/types.d.cts +1 -1
- package/__cjs/core/ApolloClient.cjs +45 -7
- package/__cjs/core/ApolloClient.cjs.map +1 -1
- package/__cjs/core/ApolloClient.d.cts +17 -4
- package/__cjs/core/ObservableQuery.cjs +40 -10
- package/__cjs/core/ObservableQuery.cjs.map +1 -1
- package/__cjs/core/ObservableQuery.d.cts +73 -9
- package/__cjs/core/types.d.cts +87 -10
- package/__cjs/link/http/HttpLink.cjs.map +1 -1
- package/__cjs/link/http/HttpLink.d.cts +11 -1
- package/__cjs/react/hooks/useBackgroundQuery.d.cts +4 -0
- package/__cjs/react/hooks/useFragment.cjs +4 -5
- package/__cjs/react/hooks/useFragment.cjs.map +1 -1
- package/__cjs/react/hooks/useFragment.d.cts +4 -7
- package/__cjs/react/hooks/useLazyQuery.d.cts +5 -1
- package/__cjs/react/hooks/useLoadableQuery.cjs.map +1 -1
- package/__cjs/react/hooks/useLoadableQuery.d.cts +209 -10
- package/__cjs/react/hooks/useQuery.cjs.map +1 -1
- package/__cjs/react/hooks/useQuery.d.cts +270 -246
- package/__cjs/react/hooks/useQueryRefHandlers.d.cts +4 -0
- package/__cjs/react/hooks/useSubscription.cjs.map +1 -1
- package/__cjs/react/hooks/useSubscription.d.cts +79 -62
- package/__cjs/react/hooks/useSuspenseFragment.cjs.map +1 -1
- package/__cjs/react/hooks/useSuspenseFragment.d.cts +2 -2
- package/__cjs/react/hooks/useSuspenseQuery.cjs.map +1 -1
- package/__cjs/react/hooks/useSuspenseQuery.d.cts +185 -161
- package/__cjs/react/index.cjs +1 -3
- package/__cjs/react/index.cjs.map +1 -1
- package/__cjs/react/index.d.cts +0 -1
- package/__cjs/react/internal/cache/FragmentReference.cjs +1 -1
- package/__cjs/react/internal/cache/FragmentReference.cjs.map +1 -1
- package/__cjs/react/types/types.documentation.d.cts +12 -1
- package/__cjs/utilities/internal/getStoreKeyName.cjs +8 -5
- package/__cjs/utilities/internal/getStoreKeyName.cjs.map +1 -1
- package/__cjs/utilities/internal/index.cjs +4 -2
- package/__cjs/utilities/internal/index.cjs.map +1 -1
- package/__cjs/utilities/internal/index.d.cts +2 -0
- package/__cjs/utilities/internal/removeFragmentSpreads.cjs +14 -0
- package/__cjs/utilities/internal/removeFragmentSpreads.cjs.map +1 -0
- package/__cjs/utilities/internal/removeFragmentSpreads.d.cts +3 -0
- package/__cjs/utilities/internal/types/DocumentationTypes.cjs +3 -0
- package/__cjs/utilities/internal/types/DocumentationTypes.cjs.map +1 -0
- package/__cjs/utilities/internal/types/DocumentationTypes.d.cts +82 -0
- package/__cjs/version.cjs +1 -1
- package/cache/core/cache.d.ts +42 -13
- package/cache/core/cache.js +2 -6
- package/cache/core/cache.js.map +1 -1
- package/cache/inmemory/entityStore.d.ts +1 -1
- package/cache/inmemory/entityStore.js +3 -3
- package/cache/inmemory/entityStore.js.map +1 -1
- package/cache/inmemory/inMemoryCache.js +1 -1
- package/cache/inmemory/inMemoryCache.js.map +1 -1
- package/cache/inmemory/types.d.ts +1 -1
- package/cache/inmemory/types.js.map +1 -1
- package/core/ApolloClient.d.ts +17 -4
- package/core/ApolloClient.js +46 -8
- package/core/ApolloClient.js.map +1 -1
- package/core/ObservableQuery.d.ts +73 -9
- package/core/ObservableQuery.js +40 -10
- package/core/ObservableQuery.js.map +1 -1
- package/core/types.d.ts +87 -10
- package/core/types.js.map +1 -1
- package/link/http/HttpLink.d.ts +11 -1
- package/link/http/HttpLink.js.map +1 -1
- package/package.json +1 -1
- package/react/hooks/useBackgroundQuery.d.ts +4 -0
- package/react/hooks/useFragment.d.ts +4 -7
- package/react/hooks/useFragment.js +4 -5
- package/react/hooks/useFragment.js.map +1 -1
- package/react/hooks/useLazyQuery.d.ts +5 -1
- package/react/hooks/useLoadableQuery.d.ts +209 -10
- package/react/hooks/useLoadableQuery.js.map +1 -1
- package/react/hooks/useQuery.d.ts +270 -246
- package/react/hooks/useQuery.js.map +1 -1
- package/react/hooks/useQueryRefHandlers.d.ts +4 -0
- package/react/hooks/useSubscription.d.ts +79 -62
- package/react/hooks/useSubscription.js.map +1 -1
- package/react/hooks/useSuspenseFragment.d.ts +2 -2
- package/react/hooks/useSuspenseFragment.js.map +1 -1
- package/react/hooks/useSuspenseQuery.d.ts +185 -161
- package/react/hooks/useSuspenseQuery.js.map +1 -1
- package/react/hooks-compiled/useBackgroundQuery.d.ts +4 -0
- package/react/hooks-compiled/useFragment.d.ts +4 -7
- package/react/hooks-compiled/useFragment.js +4 -5
- package/react/hooks-compiled/useFragment.js.map +1 -1
- package/react/hooks-compiled/useLazyQuery.d.ts +5 -1
- package/react/hooks-compiled/useLoadableQuery.d.ts +209 -10
- package/react/hooks-compiled/useLoadableQuery.js.map +1 -1
- package/react/hooks-compiled/useQuery.d.ts +270 -246
- package/react/hooks-compiled/useQuery.js.map +1 -1
- package/react/hooks-compiled/useQueryRefHandlers.d.ts +4 -0
- package/react/hooks-compiled/useSubscription.d.ts +79 -62
- package/react/hooks-compiled/useSubscription.js.map +1 -1
- package/react/hooks-compiled/useSuspenseFragment.d.ts +2 -2
- package/react/hooks-compiled/useSuspenseFragment.js.map +1 -1
- package/react/hooks-compiled/useSuspenseQuery.d.ts +185 -161
- package/react/hooks-compiled/useSuspenseQuery.js.map +1 -1
- package/react/index.compiled.d.ts +0 -1
- package/react/index.compiled.js +0 -1
- package/react/index.compiled.js.map +1 -1
- package/react/index.d.ts +0 -1
- package/react/index.js +0 -1
- package/react/index.js.map +1 -1
- package/react/internal/cache/FragmentReference.js +1 -1
- package/react/internal/cache/FragmentReference.js.map +1 -1
- package/react/types/types.documentation.d.ts +12 -1
- package/react/types/types.documentation.js.map +1 -1
- package/utilities/internal/getStoreKeyName.js +8 -5
- package/utilities/internal/getStoreKeyName.js.map +1 -1
- package/utilities/internal/index.d.ts +2 -0
- package/utilities/internal/index.js +1 -0
- package/utilities/internal/index.js.map +1 -1
- package/utilities/internal/removeFragmentSpreads.d.ts +3 -0
- package/utilities/internal/removeFragmentSpreads.js +11 -0
- package/utilities/internal/removeFragmentSpreads.js.map +1 -0
- package/utilities/internal/types/DocumentationTypes.d.ts +82 -0
- package/utilities/internal/types/DocumentationTypes.js +2 -0
- package/utilities/internal/types/DocumentationTypes.js.map +1 -0
- package/version.js +1 -1
|
@@ -205,6 +205,37 @@ export declare namespace ObservableQuery {
|
|
|
205
205
|
*/
|
|
206
206
|
retain(): this;
|
|
207
207
|
}
|
|
208
|
+
namespace DocumentationTypes {
|
|
209
|
+
type OperatorFunctionChain<From, To> = [];
|
|
210
|
+
interface ObservableMethods<TData, OperatorResult> {
|
|
211
|
+
/**
|
|
212
|
+
* Used to stitch together functional operators into a chain.
|
|
213
|
+
*
|
|
214
|
+
* @returns The Observable result of all the operators having been called in the order they were passed in.
|
|
215
|
+
*
|
|
216
|
+
* @example
|
|
217
|
+
* ```ts
|
|
218
|
+
* import { filter, map } from 'rxjs';
|
|
219
|
+
*
|
|
220
|
+
* observableQuery
|
|
221
|
+
* .pipe(
|
|
222
|
+
* filter(...),
|
|
223
|
+
* map(...),
|
|
224
|
+
* )
|
|
225
|
+
* .subscribe(x => console.log(x));
|
|
226
|
+
* ```
|
|
227
|
+
*/
|
|
228
|
+
pipe(...operators: OperatorFunctionChain<ApolloQueryResult<TData>, OperatorResult>): Observable<OperatorResult>;
|
|
229
|
+
/**
|
|
230
|
+
* Subscribes to the `ObservableQuery`.
|
|
231
|
+
*
|
|
232
|
+
* @param observerOrNext - Either an RxJS `Observer` with some or all callback methods, or the `next` handler that is called for each value emitted from the subscribed Observable.
|
|
233
|
+
*
|
|
234
|
+
* @returns A subscription reference to the registered handlers.
|
|
235
|
+
*/
|
|
236
|
+
subscribe(observerOrNext: Partial<Observer<ApolloQueryResult<MaybeMasked<TData>>>> | ((value: ApolloQueryResult<MaybeMasked<TData>>) => void)): Subscription;
|
|
237
|
+
}
|
|
238
|
+
}
|
|
208
239
|
}
|
|
209
240
|
export declare class ObservableQuery<TData = unknown, TVariables extends OperationVariables = OperationVariables> implements Subscribable<ApolloQueryResult<MaybeMasked<TData>>>, InteropObservable<ApolloQueryResult<MaybeMasked<TData>>> {
|
|
210
241
|
readonly options: ObservableQuery.Options<TData, TVariables>;
|
|
@@ -243,7 +274,32 @@ export declare class ObservableQuery<TData = unknown, TVariables extends Operati
|
|
|
243
274
|
queryId?: string;
|
|
244
275
|
});
|
|
245
276
|
private initializeObservablesQueue;
|
|
246
|
-
|
|
277
|
+
/**
|
|
278
|
+
* Subscribes to the `ObservableQuery`.
|
|
279
|
+
* @param observerOrNext - Either an RxJS `Observer` with some or all callback methods,
|
|
280
|
+
* or the `next` handler that is called for each value emitted from the subscribed Observable.
|
|
281
|
+
* @returns A subscription reference to the registered handlers.
|
|
282
|
+
*/
|
|
283
|
+
subscribe: (observerOrNext: Partial<Observer<ApolloQueryResult<MaybeMasked<TData>>>> | ((value: ApolloQueryResult<MaybeMasked<TData>>) => void)) => Subscription;
|
|
284
|
+
/**
|
|
285
|
+
* Used to stitch together functional operators into a chain.
|
|
286
|
+
*
|
|
287
|
+
* @example
|
|
288
|
+
*
|
|
289
|
+
* ```ts
|
|
290
|
+
* import { filter, map } from 'rxjs';
|
|
291
|
+
*
|
|
292
|
+
* observableQuery
|
|
293
|
+
* .pipe(
|
|
294
|
+
* filter(...),
|
|
295
|
+
* map(...),
|
|
296
|
+
* )
|
|
297
|
+
* .subscribe(x => console.log(x));
|
|
298
|
+
* ```
|
|
299
|
+
*
|
|
300
|
+
* @returns The Observable result of all the operators having been called
|
|
301
|
+
* in the order they were passed in.
|
|
302
|
+
*/
|
|
247
303
|
pipe: Observable<ApolloQueryResult<MaybeMasked<TData>>>["pipe"];
|
|
248
304
|
[Symbol.observable]: () => Subscribable<ApolloQueryResult<MaybeMasked<TData>>>;
|
|
249
305
|
["@@observable"]: () => Subscribable<ApolloQueryResult<MaybeMasked<TData>>>;
|
|
@@ -263,6 +319,13 @@ export declare class ObservableQuery<TData = unknown, TVariables extends Operati
|
|
|
263
319
|
* Update the variables of this observable query, and fetch the new results.
|
|
264
320
|
* This method should be preferred over `setVariables` in most use cases.
|
|
265
321
|
*
|
|
322
|
+
* Returns a `ResultPromise` with an additional `.retain()` method. Calling
|
|
323
|
+
* `.retain()` keeps the network operation running even if the `ObservableQuery`
|
|
324
|
+
* no longer requires the result.
|
|
325
|
+
*
|
|
326
|
+
* Note: `refetch()` guarantees that a value will be emitted from the
|
|
327
|
+
* observable, even if the result is deep equal to the previous value.
|
|
328
|
+
*
|
|
266
329
|
* @param variables - The new set of variables. If there are missing variables,
|
|
267
330
|
* the previous values of those variables will be used.
|
|
268
331
|
*/
|
|
@@ -270,7 +333,7 @@ export declare class ObservableQuery<TData = unknown, TVariables extends Operati
|
|
|
270
333
|
/**
|
|
271
334
|
* 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/).
|
|
272
335
|
*/
|
|
273
|
-
fetchMore<TFetchData = TData, TFetchVars extends OperationVariables = TVariables>(
|
|
336
|
+
fetchMore<TFetchData = TData, TFetchVars extends OperationVariables = TVariables>(options: FetchMoreOptions<TData, TVariables, TFetchData, TFetchVars>): Promise<QueryResult<TFetchData>>;
|
|
274
337
|
/**
|
|
275
338
|
* 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.
|
|
276
339
|
*
|
|
@@ -289,14 +352,12 @@ export declare class ObservableQuery<TData = unknown, TVariables extends Operati
|
|
|
289
352
|
* `setVariables` in order to to be properly notified of results even when
|
|
290
353
|
* they come from the cache.
|
|
291
354
|
*
|
|
292
|
-
* Note:
|
|
293
|
-
*
|
|
294
|
-
*
|
|
295
|
-
* Note: the promise will return the old results immediately if the variables
|
|
296
|
-
* have not changed.
|
|
355
|
+
* Note: `setVariables()` guarantees that a value will be emitted from the
|
|
356
|
+
* observable, even if the result is deeply equal to the previous value.
|
|
297
357
|
*
|
|
298
|
-
* Note: the promise will
|
|
299
|
-
*
|
|
358
|
+
* Note: the promise will resolve with the last emitted result
|
|
359
|
+
* when either the variables match the current variables or there
|
|
360
|
+
* are no subscribers to the query.
|
|
300
361
|
*
|
|
301
362
|
* @param variables - The new set of variables. If there are missing variables,
|
|
302
363
|
* the previous values of those variables will be used.
|
|
@@ -324,6 +385,9 @@ export declare class ObservableQuery<TData = unknown, TVariables extends Operati
|
|
|
324
385
|
/**
|
|
325
386
|
* Reevaluate the query, optionally against new options. New options will be
|
|
326
387
|
* merged with the current options when given.
|
|
388
|
+
*
|
|
389
|
+
* Note: `variables` can be reset back to their defaults (typically empty) by calling `reobserve` with
|
|
390
|
+
* `variables: undefined`.
|
|
327
391
|
*/
|
|
328
392
|
reobserve(newOptions?: Partial<ObservableQuery.Options<TData, TVariables>>): ObservableQuery.ResultPromise<QueryResult<MaybeMasked<TData>>>;
|
|
329
393
|
private _reobserve;
|
package/__cjs/core/types.d.cts
CHANGED
|
@@ -181,43 +181,120 @@ export type InternalRefetchQueriesMap<TResult> = Map<ObservableQuery<any>, Inter
|
|
|
181
181
|
export type OperationVariables = Record<string, any>;
|
|
182
182
|
export type ApolloQueryResult<TData, TStates extends DataState<TData>["dataState"] = DataState<TData>["dataState"]> = {
|
|
183
183
|
/**
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
184
|
+
* A single ErrorLike object describing the error that occured during the latest query execution.
|
|
185
|
+
*
|
|
186
|
+
* For more information, see [Handling operation errors](https://www.apollographql.com/docs/react/data/error-handling/).
|
|
187
|
+
*
|
|
188
|
+
* @docGroup
|
|
189
|
+
*
|
|
190
|
+
* 1. Operation data
|
|
191
|
+
*/
|
|
188
192
|
error?: ErrorLike;
|
|
193
|
+
/**
|
|
194
|
+
* If `true`, the query is still in flight and results have not yet been returned.
|
|
195
|
+
*
|
|
196
|
+
* @docGroup
|
|
197
|
+
*
|
|
198
|
+
* 2. Network info
|
|
199
|
+
*/
|
|
189
200
|
loading: boolean;
|
|
201
|
+
/**
|
|
202
|
+
* 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)
|
|
203
|
+
*
|
|
204
|
+
* Used in conjunction with the [`notifyOnNetworkStatusChange`](#notifyonnetworkstatuschange) option.
|
|
205
|
+
*
|
|
206
|
+
* @docGroup
|
|
207
|
+
*
|
|
208
|
+
* 2. Network info
|
|
209
|
+
*/
|
|
190
210
|
networkStatus: NetworkStatus;
|
|
191
211
|
/**
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
212
|
+
* Describes whether `data` is a complete or partial result. This flag is only set when `returnPartialData` is `true` in query options.
|
|
213
|
+
*
|
|
214
|
+
* @deprecated
|
|
215
|
+
*
|
|
216
|
+
* This field will be removed in a future version of Apollo Client.
|
|
217
|
+
*
|
|
218
|
+
* @docGroup
|
|
219
|
+
*
|
|
220
|
+
* 1. Operation data
|
|
221
|
+
*/
|
|
197
222
|
partial: boolean;
|
|
198
223
|
} & GetDataState<TData, TStates>;
|
|
199
224
|
export type DataState<TData> = {
|
|
225
|
+
/**
|
|
226
|
+
* An object containing the result of your GraphQL query after it completes.
|
|
227
|
+
*
|
|
228
|
+
* This value might be `undefined` if a query results in one or more errors (depending on the query's `errorPolicy`).
|
|
229
|
+
*
|
|
230
|
+
* @docGroup
|
|
231
|
+
*
|
|
232
|
+
* 1. Operation data
|
|
233
|
+
*/
|
|
200
234
|
data: DataValue.Complete<TData>;
|
|
201
235
|
/**
|
|
202
236
|
* Describes the completeness of `data`. - `empty`: No data could be fulfilled from the cache or the result is incomplete. `data` is `undefined`. - `partial`: Some data could be fulfilled from the cache but `data` is incomplete. This is only possible when `returnPartialData` is `true`. - `streaming`: `data` is incomplete as a result of a deferred query and the result is still streaming in. - `complete`: `data` is a fully satisfied query result fulfilled either from the cache or network.
|
|
237
|
+
*
|
|
238
|
+
* @docGroup
|
|
239
|
+
*
|
|
240
|
+
* 1. Operation data
|
|
203
241
|
*/
|
|
204
242
|
dataState: "complete";
|
|
205
243
|
} | {
|
|
244
|
+
/**
|
|
245
|
+
* An object containing the result of your GraphQL query after it completes.
|
|
246
|
+
*
|
|
247
|
+
* This value might be `undefined` if a query results in one or more errors (depending on the query's `errorPolicy`).
|
|
248
|
+
*
|
|
249
|
+
* @docGroup
|
|
250
|
+
*
|
|
251
|
+
* 1. Operation data
|
|
252
|
+
*/
|
|
206
253
|
data: DataValue.Streaming<TData>;
|
|
207
254
|
/**
|
|
208
255
|
* Describes the completeness of `data`. - `empty`: No data could be fulfilled from the cache or the result is incomplete. `data` is `undefined`. - `partial`: Some data could be fulfilled from the cache but `data` is incomplete. This is only possible when `returnPartialData` is `true`. - `streaming`: `data` is incomplete as a result of a deferred query and the result is still streaming in. - `complete`: `data` is a fully satisfied query result fulfilled either from the cache or network.
|
|
256
|
+
*
|
|
257
|
+
* @docGroup
|
|
258
|
+
*
|
|
259
|
+
* 1. Operation data
|
|
209
260
|
*/
|
|
210
261
|
dataState: "streaming";
|
|
211
262
|
} | {
|
|
263
|
+
/**
|
|
264
|
+
* An object containing the result of your GraphQL query after it completes.
|
|
265
|
+
*
|
|
266
|
+
* This value might be `undefined` if a query results in one or more errors (depending on the query's `errorPolicy`).
|
|
267
|
+
*
|
|
268
|
+
* @docGroup
|
|
269
|
+
*
|
|
270
|
+
* 1. Operation data
|
|
271
|
+
*/
|
|
212
272
|
data: DataValue.Partial<TData>;
|
|
213
273
|
/**
|
|
214
274
|
* Describes the completeness of `data`. - `empty`: No data could be fulfilled from the cache or the result is incomplete. `data` is `undefined`. - `partial`: Some data could be fulfilled from the cache but `data` is incomplete. This is only possible when `returnPartialData` is `true`. - `streaming`: `data` is incomplete as a result of a deferred query and the result is still streaming in. - `complete`: `data` is a fully satisfied query result fulfilled either from the cache or network.
|
|
275
|
+
*
|
|
276
|
+
* @docGroup
|
|
277
|
+
*
|
|
278
|
+
* 1. Operation data
|
|
215
279
|
*/
|
|
216
280
|
dataState: "partial";
|
|
217
281
|
} | {
|
|
282
|
+
/**
|
|
283
|
+
* An object containing the result of your GraphQL query after it completes.
|
|
284
|
+
*
|
|
285
|
+
* This value might be `undefined` if a query results in one or more errors (depending on the query's `errorPolicy`).
|
|
286
|
+
*
|
|
287
|
+
* @docGroup
|
|
288
|
+
*
|
|
289
|
+
* 1. Operation data
|
|
290
|
+
*/
|
|
218
291
|
data: undefined;
|
|
219
292
|
/**
|
|
220
293
|
* Describes the completeness of `data`. - `empty`: No data could be fulfilled from the cache or the result is incomplete. `data` is `undefined`. - `partial`: Some data could be fulfilled from the cache but `data` is incomplete. This is only possible when `returnPartialData` is `true`. - `streaming`: `data` is incomplete as a result of a deferred query and the result is still streaming in. - `complete`: `data` is a fully satisfied query result fulfilled either from the cache or network.
|
|
294
|
+
*
|
|
295
|
+
* @docGroup
|
|
296
|
+
*
|
|
297
|
+
* 1. Operation data
|
|
221
298
|
*/
|
|
222
299
|
dataState: "empty";
|
|
223
300
|
};
|
|
@@ -288,7 +365,7 @@ export interface QueryResult<TData = unknown> {
|
|
|
288
365
|
*/
|
|
289
366
|
data: TData | undefined;
|
|
290
367
|
/**
|
|
291
|
-
*
|
|
368
|
+
* A single ErrorLike object describing the error that occured during the latest query execution.
|
|
292
369
|
*
|
|
293
370
|
* For more information, see [Handling operation errors](https://www.apollographql.com/docs/react/data/error-handling/).
|
|
294
371
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HttpLink.cjs","sources":["../../../../src/link/http/HttpLink.ts"],"sourcesContent":["import type { ASTNode } from \"graphql\";\n\nimport type { Operation } from \"@apollo/client/link\";\nimport { ApolloLink } from \"@apollo/client/link\";\nimport { ClientAwarenessLink } from \"@apollo/client/link/client-awareness\";\nimport type { print } from \"@apollo/client/utilities\";\n\nimport { BaseHttpLink } from \"./BaseHttpLink.js\";\n\nexport declare namespace HttpLink {\n interface ContextOptions {\n /**\n * The URL of the GraphQL endpoint to send requests to. Can also be a\n * function that accepts an `Operation` object and returns the string URL to\n * use for that operation.\n */\n uri?: string | UriFunction;\n\n /**\n * An object representing headers to include in the HTTP request, such as\n * `{Authorization: 'Bearer abc123'}`.\n */\n headers?: Record<string, string>;\n\n /**\n * The credentials policy to use for this fetch call. Can be `omit`, `include`,\n * or `same-origin`.\n */\n credentials?: RequestCredentials;\n\n /**\n * An object containing options to use for this call to `fetch`. If a\n * particular option is not included in this object, the default value of\n * that option is used.\n *\n * Note that if you set `fetchOptions.method` to `GET`, `HttpLink` follows\n * [standard GraphQL HTTP GET encoding](http://graphql.org/learn/serving-over-http/#get-request).\n */\n fetchOptions?: RequestInit;\n\n /**\n * An object that configures advanced `HttpLink` functionality, such as\n * support for persisted queries.\n */\n http?: HttpOptions;\n }\n\n export interface HttpOptions {\n /**\n * If `true`, includes the `extensions` field in operations sent to your\n * GraphQL endpoint.\n *\n * @defaultValue true\n */\n includeExtensions?: boolean;\n\n /**\n * If `false`, the GraphQL query string is not included in the request. Set\n * this option if you're sending a request that uses a [persisted query](https://www.apollographql.com/docs/react/api/link/persisted-queries/).\n *\n * @defaultValue true\n */\n includeQuery?: boolean;\n\n /**\n * If set to true, header names won't be automatically normalized to\n * lowercase. This allows for non-http-spec-compliant servers that might\n * expect capitalized header names.\n *\n * @defaultValue false\n */\n preserveHeaderCase?: boolean;\n\n /**\n * A list of additional `accept` headers to include in the request,\n * as defined in\n * https://datatracker.ietf.org/doc/html/rfc7231#section-5.3.2\n *\n * @example\n * ```javascript\n * [\"application/custom+json;q=1.0\"]\n * ```\n */\n accept?: string[];\n }\n\n export interface Options {\n /**\n * The URI to use when fetching operations.\n *\n * Defaults to '/graphql'.\n */\n uri?: string | UriFunction;\n\n /**\n * Passes the extensions field to your graphql server.\n *\n * Defaults to true.\n */\n includeExtensions?: boolean;\n\n /**\n * A `fetch`-compatible API to use when making requests.\n */\n fetch?: typeof fetch;\n\n /**\n * An object representing values to be sent as headers on the request.\n */\n headers?: Record<string, string>;\n\n /**\n * If set to true, header names won't be automatically normalized to\n * lowercase. This allows for non-http-spec-compliant servers that might\n * expect capitalized header names.\n */\n preserveHeaderCase?: boolean;\n\n /**\n * The credentials policy you want to use for the fetch call.\n */\n credentials?: string;\n\n /**\n * Any overrides of the fetch options argument to pass to the fetch call.\n */\n fetchOptions?: any;\n\n /**\n * If set to true, use the HTTP GET method for query operations. Mutations\n * will still use the method specified in fetchOptions.method (which defaults\n * to POST).\n */\n useGETForQueries?: boolean;\n\n /**\n * If set to true, the default behavior of stripping unused variables\n * from the request will be disabled.\n *\n * Unused variables are likely to trigger server-side validation errors,\n * per https://spec.graphql.org/draft/#sec-All-Variables-Used, but this\n * includeUnusedVariables option can be useful if your server deviates\n * from the GraphQL specification by not strictly enforcing that rule.\n */\n includeUnusedVariables?: boolean;\n /**\n * A function to substitute for the default query print function. Can be\n * used to apply changes to the results of the print function.\n */\n print?: Printer;\n }\n\n interface Body {\n query?: string;\n operationName?: string;\n variables?: Record<string, any>;\n extensions?: Record<string, any>;\n }\n\n type Printer = (node: ASTNode, originalPrint: typeof print) => string;\n type UriFunction = (operation: Operation) => string;\n}\n\nexport class HttpLink extends ApolloLink {\n constructor(options: HttpLink.Options & ClientAwarenessLink.Options = {}) {\n const { left, right, request } = ApolloLink.concat(\n new ClientAwarenessLink(options),\n new BaseHttpLink(options)\n );\n super(request);\n Object.assign(this, { left, right });\n }\n}\n\n/**\n * @deprecated\n * Use `HttpLink` from `@apollo/client/link/http` instead.\n */\nexport const createHttpLink = (\n linkOptions: HttpLink.Options & ClientAwarenessLink.Options = {}\n) => new HttpLink(linkOptions);\n"],"names":[],"mappings":";;;AAGA,CAAA,CAAA,CAAA,CAAA,EAAA,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;AACA,CAAA,CAAA,CAAA,CAAA,EAAA,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,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;AAGA,CAAA,CAAA,CAAA,CAAA,EAAA,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,qBAAA,CAAA;
|
|
1
|
+
{"version":3,"file":"HttpLink.cjs","sources":["../../../../src/link/http/HttpLink.ts"],"sourcesContent":["import type { ASTNode } from \"graphql\";\n\nimport type { Operation } from \"@apollo/client/link\";\nimport { ApolloLink } from \"@apollo/client/link\";\nimport { ClientAwarenessLink } from \"@apollo/client/link/client-awareness\";\nimport type { print } from \"@apollo/client/utilities\";\n\nimport { BaseHttpLink } from \"./BaseHttpLink.js\";\n\nexport declare namespace HttpLink {\n /**\n * Options passed to `HttpLink` through request context.\n */\n interface ContextOptions {\n /**\n * The URL of the GraphQL endpoint to send requests to. Can also be a\n * function that accepts an `Operation` object and returns the string URL to\n * use for that operation.\n */\n uri?: string | UriFunction;\n\n /**\n * An object representing headers to include in the HTTP request, such as\n * `{Authorization: 'Bearer abc123'}`.\n */\n headers?: Record<string, string>;\n\n /**\n * The credentials policy to use for this fetch call. Can be `omit`, `include`,\n * or `same-origin`.\n */\n credentials?: RequestCredentials;\n\n /**\n * An object containing options to use for this call to `fetch`. If a\n * particular option is not included in this object, the default value of\n * that option is used.\n *\n * Note that if you set `fetchOptions.method` to `GET`, `HttpLink` follows\n * [standard GraphQL HTTP GET encoding](http://graphql.org/learn/serving-over-http/#get-request).\n */\n fetchOptions?: RequestInit;\n\n /**\n * An object that configures advanced `HttpLink` functionality, such as\n * support for persisted queries.\n */\n http?: HttpLink.HttpOptions;\n }\n\n /**\n * Options passed to `HttpLink` through the `http` constructor option\n * or the `http` property of a request context.\n */\n export interface HttpOptions {\n /**\n * If `true`, includes the `extensions` field in operations sent to your\n * GraphQL endpoint.\n *\n * @defaultValue true\n */\n includeExtensions?: boolean;\n\n /**\n * If `false`, the GraphQL query string is not included in the request. Set\n * this option if you're sending a request that uses a [persisted query](https://www.apollographql.com/docs/react/api/link/persisted-queries/).\n *\n * @defaultValue true\n */\n includeQuery?: boolean;\n\n /**\n * If set to true, header names won't be automatically normalized to\n * lowercase. This allows for non-http-spec-compliant servers that might\n * expect capitalized header names.\n *\n * @defaultValue false\n */\n preserveHeaderCase?: boolean;\n\n /**\n * A list of additional `accept` headers to include in the request,\n * as defined in\n * https://datatracker.ietf.org/doc/html/rfc7231#section-5.3.2\n *\n * @example\n * ```javascript\n * [\"application/custom+json;q=1.0\"]\n * ```\n */\n accept?: string[];\n }\n\n /**\n * Options for the `HttpLink` constructor.\n */\n export interface Options {\n /**\n * The URI to use when fetching operations.\n *\n * Defaults to '/graphql'.\n */\n uri?: string | UriFunction;\n\n /**\n * Passes the extensions field to your graphql server.\n *\n * Defaults to true.\n */\n includeExtensions?: boolean;\n\n /**\n * A `fetch`-compatible API to use when making requests.\n */\n fetch?: typeof fetch;\n\n /**\n * An object representing values to be sent as headers on the request.\n */\n headers?: Record<string, string>;\n\n /**\n * If set to true, header names won't be automatically normalized to\n * lowercase. This allows for non-http-spec-compliant servers that might\n * expect capitalized header names.\n */\n preserveHeaderCase?: boolean;\n\n /**\n * The credentials policy you want to use for the fetch call.\n */\n credentials?: string;\n\n /**\n * Any overrides of the fetch options argument to pass to the fetch call.\n */\n fetchOptions?: any;\n\n /**\n * If set to true, use the HTTP GET method for query operations. Mutations\n * will still use the method specified in fetchOptions.method (which defaults\n * to POST).\n */\n useGETForQueries?: boolean;\n\n /**\n * If set to true, the default behavior of stripping unused variables\n * from the request will be disabled.\n *\n * Unused variables are likely to trigger server-side validation errors,\n * per https://spec.graphql.org/draft/#sec-All-Variables-Used, but this\n * includeUnusedVariables option can be useful if your server deviates\n * from the GraphQL specification by not strictly enforcing that rule.\n */\n includeUnusedVariables?: boolean;\n /**\n * A function to substitute for the default query print function. Can be\n * used to apply changes to the results of the print function.\n */\n print?: Printer;\n }\n\n interface Body {\n query?: string;\n operationName?: string;\n variables?: Record<string, any>;\n extensions?: Record<string, any>;\n }\n\n type Printer = (node: ASTNode, originalPrint: typeof print) => string;\n type UriFunction = (operation: Operation) => string;\n}\n\nexport class HttpLink extends ApolloLink {\n constructor(options: HttpLink.Options & ClientAwarenessLink.Options = {}) {\n const { left, right, request } = ApolloLink.concat(\n new ClientAwarenessLink(options),\n new BaseHttpLink(options)\n );\n super(request);\n Object.assign(this, { left, right });\n }\n}\n\n/**\n * @deprecated\n * Use `HttpLink` from `@apollo/client/link/http` instead.\n */\nexport const createHttpLink = (\n linkOptions: HttpLink.Options & ClientAwarenessLink.Options = {}\n) => new Http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AA,CAAA,EAAA,CAAuC,CAAC;IACtC;AACF;AATA,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;AAWA,CAAA,CAAA;;;CAGA,CAAA;AACO,CAAP,CAAA,CAAA,CAAA,EAAa,CAAb,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAA8B,CAC5B,CADF,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EACgE,CADhE,CACkE,EAChE,CAFF,EAEK,CAFL,CAAA,EAES,CAFT,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAEiB,CAAC,CAFlB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAE6B,CAAC;AAFjB,CAAb,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAa,CAAb,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;"}
|
|
@@ -4,6 +4,9 @@ import { ApolloLink } from "@apollo/client/link";
|
|
|
4
4
|
import { ClientAwarenessLink } from "@apollo/client/link/client-awareness";
|
|
5
5
|
import type { print } from "@apollo/client/utilities";
|
|
6
6
|
export declare namespace HttpLink {
|
|
7
|
+
/**
|
|
8
|
+
* Options passed to `HttpLink` through request context.
|
|
9
|
+
*/
|
|
7
10
|
interface ContextOptions {
|
|
8
11
|
/**
|
|
9
12
|
* The URL of the GraphQL endpoint to send requests to. Can also be a
|
|
@@ -34,8 +37,12 @@ export declare namespace HttpLink {
|
|
|
34
37
|
* An object that configures advanced `HttpLink` functionality, such as
|
|
35
38
|
* support for persisted queries.
|
|
36
39
|
*/
|
|
37
|
-
http?: HttpOptions;
|
|
40
|
+
http?: HttpLink.HttpOptions;
|
|
38
41
|
}
|
|
42
|
+
/**
|
|
43
|
+
* Options passed to `HttpLink` through the `http` constructor option
|
|
44
|
+
* or the `http` property of a request context.
|
|
45
|
+
*/
|
|
39
46
|
interface HttpOptions {
|
|
40
47
|
/**
|
|
41
48
|
* If `true`, includes the `extensions` field in operations sent to your
|
|
@@ -71,6 +78,9 @@ export declare namespace HttpLink {
|
|
|
71
78
|
*/
|
|
72
79
|
accept?: string[];
|
|
73
80
|
}
|
|
81
|
+
/**
|
|
82
|
+
* Options for the `HttpLink` constructor.
|
|
83
|
+
*/
|
|
74
84
|
interface Options {
|
|
75
85
|
/**
|
|
76
86
|
* The URI to use when fetching operations.
|
|
@@ -113,6 +113,10 @@ export declare namespace useBackgroundQuery {
|
|
|
113
113
|
/**
|
|
114
114
|
* Update the variables of this observable query, and fetch the new results. This method should be preferred over `setVariables` in most use cases.
|
|
115
115
|
*
|
|
116
|
+
* Returns a `ResultPromise` with an additional `.retain()` method. Calling `.retain()` keeps the network operation running even if the `ObservableQuery` no longer requires the result.
|
|
117
|
+
*
|
|
118
|
+
* Note: `refetch()` guarantees that a value will be emitted from the observable, even if the result is deep equal to the previous value.
|
|
119
|
+
*
|
|
116
120
|
* @param variables - The new set of variables. If there are missing variables, the previous values of those variables will be used.
|
|
117
121
|
*/
|
|
118
122
|
refetch: RefetchFunction<TData, TVariables>;
|
|
@@ -42,7 +42,7 @@ function useFragment_(options) {
|
|
|
42
42
|
...stableOptions,
|
|
43
43
|
returnPartialData: true,
|
|
44
44
|
id: from,
|
|
45
|
-
query: cache["getFragmentDoc"](fragment, fragmentName),
|
|
45
|
+
query: cache["getFragmentDoc"](client["transform"](fragment), fragmentName),
|
|
46
46
|
optimistic,
|
|
47
47
|
});
|
|
48
48
|
return {
|
|
@@ -55,8 +55,7 @@ function useFragment_(options) {
|
|
|
55
55
|
// valid return value
|
|
56
56
|
data: diff.result === null ? {} : diff.result,
|
|
57
57
|
}),
|
|
58
|
-
}
|
|
59
|
-
),
|
|
58
|
+
}),
|
|
60
59
|
};
|
|
61
60
|
}, [client, stableOptions]);
|
|
62
61
|
// Used for both getSnapshot and getServerSnapshot
|
|
@@ -67,8 +66,7 @@ function useFragment_(options) {
|
|
|
67
66
|
null
|
|
68
67
|
: client.watchFragment(stableOptions).subscribe({
|
|
69
68
|
next: (result) => {
|
|
70
|
-
//
|
|
71
|
-
// unnecessarily rerendering this hook for the initial result
|
|
69
|
+
// Avoid unnecessarily rerendering this hook for the initial result
|
|
72
70
|
// emitted from watchFragment which should be equal to
|
|
73
71
|
// `diff.result`.
|
|
74
72
|
if ((0, equality_1.default)(result, diff.result))
|
|
@@ -92,6 +90,7 @@ function diffToResult(diff) {
|
|
|
92
90
|
const result = {
|
|
93
91
|
data: diff.result,
|
|
94
92
|
complete: !!diff.complete,
|
|
93
|
+
dataState: diff.complete ? "complete" : "partial",
|
|
95
94
|
}; // TODO: Remove assertion once useFragment returns null
|
|
96
95
|
if (diff.missing) {
|
|
97
96
|
result.missing = diff.missing.missing;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFragment.cjs","sources":["../../../../src/react/hooks/useFragment.ts"],"sourcesContent":["import equal from \"@wry/equality\";\nimport * as React from \"react\";\n\nimport type {\n ApolloClient,\n DocumentNode,\n OperationVariables,\n TypedDocumentNode,\n} from \"@apollo/client\";\nimport type {\n Cache,\n MissingTree,\n Reference,\n StoreObject,\n} from \"@apollo/client/cache\";\nimport type { FragmentType, MaybeMasked } from \"@apollo/client/masking\";\nimport type { DeepPartial } from \"@apollo/client/utilities\";\nimport type { NoInfer } from \"@apollo/client/utilities/internal\";\n\nimport { useDeepMemo, wrapHook } from \"./internal/index.js\";\nimport { useApolloClient } from \"./useApolloClient.js\";\nimport { useSyncExternalStore } from \"./useSyncExternalStore.js\";\n\nexport declare namespace useFragment {\n export interface Options<TData, TVariables> {\n /**\n * A GraphQL document created using the `gql` template string tag from\n * `graphql-tag` with one or more fragments which will be used to determine\n * the shape of data to read. If you provide more than one fragment in this\n * document then you must also specify `fragmentName` to select a single.\n */\n fragment: DocumentNode | TypedDocumentNode<TData, TVariables>;\n\n /**\n * The name of the fragment in your GraphQL document to be used. If you do\n * not provide a `fragmentName` and there is only one fragment in your\n * `fragment` document then that fragment will be used.\n */\n fragmentName?: string;\n\n /**\n * Any variables that the GraphQL query may depend on.\n */\n variables?: NoInfer<TVariables>;\n\n from:\n | StoreObject\n | Reference\n | FragmentType<NoInfer<TData>>\n | string\n | null;\n\n /**\n * Whether to read from optimistic or non-optimistic cache data. If\n * this named option is provided, the optimistic parameter of the\n * readQuery method can be omitted.\n *\n * @defaultValue true\n */\n optimistic?: boolean;\n\n /**\n * The instance of `ApolloClient` to use to look up the fragment.\n *\n * By default, the instance that's passed down via context is used, but you\n * can provide a different instance here.\n *\n * @docGroup 1. Operation options\n */\n client?: ApolloClient;\n }\n\n // TODO: Update this to return `null` when there is no data returned from the\n // fragment.\n export type Result<TData> =\n | {\n data: MaybeMasked<TData>;\n complete: true;\n missing?: never;\n }\n | {\n data: DeepPartial<MaybeMasked<TData>>;\n complete: false;\n missing?: MissingTree;\n };\n}\n\nexport function useFragment<\n TData = unknown,\n TVariables extends OperationVariables = OperationVariables,\n>(options: useFragment.Options<TData, TVariables>): useFragment.Result<TData> {\n \"use no memo\";\n return wrapHook(\n \"useFragment\",\n // eslint-disable-next-line react-compiler/react-compiler\n useFragment_,\n useApolloClient(options.client)\n )(options);\n}\n\nfunction useFragment_<TData, TVariables extends OperationVariables>(\n options: useFragment.Options<TData, TVariables>\n): useFragment.Result<TData> {\n const client = useApolloClient(options.client);\n const { cache } = client;\n const { from, ...rest } = options;\n\n // We calculate the cache id seperately from `stableOptions` because we don't\n // want changes to non key fields in the `from` property to affect\n // `stableOptions` and retrigger our subscription. If the cache identifier\n // stays the same between renders, we want to reuse the existing subscription.\n const id = React.useMemo(\n () =>\n typeof from === \"string\" ? from\n : from === null ? null\n : cache.identify(from),\n [cache, from]\n );\n\n const stableOptions = useDeepMemo(() => ({ ...rest, from: id! }), [rest, id]);\n\n // Since .next is async, we need to make sure that we\n // get the correct diff on the next render given new diffOptions\n const diff = React.useMemo(() => {\n const { fragment, fragmentName, from, optimistic = true } = stableOptions;\n\n if (from === null) {\n return {\n result: diffToResult({\n result: {},\n complete: false,\n } as Cache.DiffResult<TData>),\n };\n }\n\n const { cache } = client;\n const diff = cache.diff<TData, TVariables>({\n ...stableOptions,\n returnPartialData: true,\n id: from,\n query: cache[\"getFragmentDoc\"](fragment, fragmentName),\n optimistic,\n });\n\n return {\n result: diffToResult(\n {\n ...diff,\n result: client[\"queryManager\"].maskFragment({\n fragment,\n fragmentName,\n // TODO: Revert to `diff.result` once `useFragment` supports `null` as\n // valid return value\n data: diff.result === null ? {} : diff.result,\n }),\n } as Cache.DiffResult<TData> // TODO: Remove assertion\n ),\n };\n }, [client, stableOptions]);\n\n // Used for both getSnapshot and getServerSnapshot\n const getSnapshot = React.useCallback(() => diff.result, [diff]);\n\n return useSyncExternalStore(\n React.useCallback(\n (forceUpdate) => {\n let lastTimeout = 0;\n\n const subscription =\n stableOptions.from === null ?\n null\n : client.watchFragment(stableOptions).subscribe({\n next: (result) => {\n // Since `next` is called async by zen-observable, we want to avoid\n // unnecessarily rerendering this hook for the initial result\n // emitted from watchFragment which should be equal to\n // `diff.result`.\n if (equal(result, diff.result)) return;\n diff.result = result;\n // If we get another update before we've re-rendered, bail out of\n // the update and try again. This ensures that the relative timing\n // between useQuery and useFragment stays roughly the same as\n // fixed in https://github.com/apollographql/apollo-client/pull/11083\n clearTimeout(lastTimeout);\n lastTimeout = setTimeout(forceUpdate) as any;\n },\n });\n return () => {\n subscription?.unsubscribe();\n clearTimeout(lastTimeout);\n };\n },\n [client, stableOptions, diff]\n ),\n getSnapshot,\n getSnapshot\n );\n}\n\nfunction diffToResult<TData>(\n diff: Cache.DiffResult<TData>\n): useFragment.Result<TData> {\n const result = {\n data: diff.result,\n complete: !!diff.complete,\n } as useFragment.Result<TData>; // TODO: Remove assertion once useFragment returns null\n\n if (diff.missing) {\n result.missing = diff.missing.missing;\n }\n\n return result;\n}\n"],"names":[],"mappings":";;AAuFA,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;;AAvFA,CAAA,CAAA,CAAA,CAAA,EAAA,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,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;AACA,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;AAkBA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,uBAAA,CAAA;AACA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AAA,CAAA,CAAA,CAAA,CAAqB;QACjB,CAAJ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAY,EAAE,CAAC,CAAC,CAAhB,CAAA,CAAA,CAAoB,CAAC,CAArB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAA6B;IAC7B,CAAgC,EAAE,CAAlC,EAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA;IAEE,CAAF,EAAA,CAAM,CAAN,CAAA,CAAA,CAAU,CAAC,CAAX,CAAA,CAAA,CAAA,CAAA,CAAA,CAAkB,EAAE;QAChB,CAAJ,CAAA,CAAA,CAAA,CAAA,CAAU,CAAC,CAAX,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAqB,CAArB,CAAA,CAAA,CAAyB,CAAC,CAA1B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAiC,CAAC,CAAlC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAyC;IACvC;IAEA,CAAF,CAAA,CAAA,CAAA,CAAA,EAAS,CAAT,CAAA,CAAA,CAAA,CAAA,CAAe;AACf;"}
|
|
1
|
+
{"version":3,"file":"useFragment.cjs","sources":["../../../../src/react/hooks/useFragment.ts"],"sourcesContent":["import equal from \"@wry/equality\";\nimport * as React from \"react\";\n\nimport type {\n ApolloClient,\n DocumentNode,\n GetDataState,\n OperationVariables,\n TypedDocumentNode,\n} from \"@apollo/client\";\nimport type {\n Cache,\n MissingTree,\n Reference,\n StoreObject,\n} from \"@apollo/client/cache\";\nimport type { FragmentType, MaybeMasked } from \"@apollo/client/masking\";\nimport type { NoInfer } from \"@apollo/client/utilities/internal\";\n\nimport { useDeepMemo, wrapHook } from \"./internal/index.js\";\nimport { useApolloClient } from \"./useApolloClient.js\";\nimport { useSyncExternalStore } from \"./useSyncExternalStore.js\";\n\nexport declare namespace useFragment {\n export interface Options<TData, TVariables> {\n /**\n * A GraphQL document created using the `gql` template string tag from\n * `graphql-tag` with one or more fragments which will be used to determine\n * the shape of data to read. If you provide more than one fragment in this\n * document then you must also specify `fragmentName` to select a single.\n */\n fragment: DocumentNode | TypedDocumentNode<TData, TVariables>;\n\n /**\n * The name of the fragment in your GraphQL document to be used. If you do\n * not provide a `fragmentName` and there is only one fragment in your\n * `fragment` document then that fragment will be used.\n */\n fragmentName?: string;\n\n /**\n * Any variables that the GraphQL query may depend on.\n */\n variables?: NoInfer<TVariables>;\n\n from:\n | StoreObject\n | Reference\n | FragmentType<NoInfer<TData>>\n | string\n | null;\n\n /**\n * Whether to read from optimistic or non-optimistic cache data. If\n * this named option is provided, the optimistic parameter of the\n * readQuery method can be omitted.\n *\n * @defaultValue true\n */\n optimistic?: boolean;\n\n /**\n * The instance of `ApolloClient` to use to look up the fragment.\n *\n * By default, the instance that's passed down via context is used, but you\n * can provide a different instance here.\n *\n * @docGroup 1. Operation options\n */\n client?: ApolloClient;\n }\n\n // TODO: Update this to return `null` when there is no data returned from the\n // fragment.\n export type Result<TData> =\n | ({\n complete: true;\n missing?: never;\n } & GetDataState<MaybeMasked<TData>, \"complete\">)\n | ({\n complete: false;\n missing?: MissingTree;\n } & GetDataState<MaybeMasked<TData>, \"partial\">);\n}\n\nexport function useFragment<\n TData = unknown,\n TVariables extends OperationVariables = OperationVariables,\n>(options: useFragment.Options<TData, TVariables>): useFragment.Result<TData> {\n \"use no memo\";\n return wrapHook(\n \"useFragment\",\n // eslint-disable-next-line react-compiler/react-compiler\n useFragment_,\n useApolloClient(options.client)\n )(options);\n}\n\nfunction useFragment_<TData, TVariables extends OperationVariables>(\n options: useFragment.Options<TData, TVariables>\n): useFragment.Result<TData> {\n const client = useApolloClient(options.client);\n const { cache } = client;\n const { from, ...rest } = options;\n\n // We calculate the cache id seperately from `stableOptions` because we don't\n // want changes to non key fields in the `from` property to affect\n // `stableOptions` and retrigger our subscription. If the cache identifier\n // stays the same between renders, we want to reuse the existing subscription.\n const id = React.useMemo(\n () =>\n typeof from === \"string\" ? from\n : from === null ? null\n : cache.identify(from),\n [cache, from]\n );\n\n const stableOptions = useDeepMemo(() => ({ ...rest, from: id! }), [rest, id]);\n\n // Since .next is async, we need to make sure that we\n // get the correct diff on the next render given new diffOptions\n const diff = React.useMemo(() => {\n const { fragment, fragmentName, from, optimistic = true } = stableOptions;\n\n if (from === null) {\n return {\n result: diffToResult({\n result: {},\n complete: false,\n } as Cache.DiffResult<TData>),\n };\n }\n\n const { cache } = client;\n const diff = cache.diff<TData, TVariables>({\n ...stableOptions,\n returnPartialData: true,\n id: from,\n query: cache[\"getFragmentDoc\"](\n client[\"transform\"](fragment),\n fragmentName\n ),\n optimistic,\n });\n\n return {\n result: diffToResult<TData>({\n ...diff,\n result: client[\"queryManager\"].maskFragment({\n fragment,\n fragmentName,\n // TODO: Revert to `diff.result` once `useFragment` supports `null` as\n // valid return value\n data: diff.result === null ? {} : diff.result,\n }) as any,\n }),\n };\n }, [client, stableOptions]);\n\n // Used for both getSnapshot and getServerSnapshot\n const getSnapshot = React.useCallback(() => diff.result, [diff]);\n\n return useSyncExternalStore(\n React.useCallback(\n (forceUpdate) => {\n let lastTimeout = 0;\n\n const subscription =\n stableOptions.from === null ?\n null\n : client.watchFragment(stableOptions).subscribe({\n next: (result) => {\n // Avoid unnecessarily rerendering this hook for the initial result\n // emitted from watchFragment which should be equal to\n // `diff.result`.\n if (equal(result, diff.result)) return;\n diff.result = result;\n // If we get another update before we've re-rendered, bail out of\n // the update and try again. This ensures that the relative timing\n // between useQuery and useFragment stays roughly the same as\n // fixed in https://github.com/apollographql/apollo-client/pull/11083\n clearTimeout(lastTimeout);\n lastTimeout = setTimeout(forceUpdate) as any;\n },\n });\n return () => {\n subscription?.unsubscribe();\n clearTimeout(lastTimeout);\n };\n },\n [client, stableOptions, diff]\n ),\n getSnapshot,\n getSnapshot\n );\n}\n\nfunction diffToResult<TData>(\n diff: Cache.DiffResult<TData>\n): useFragment.Result<TData> {\n const result = {\n data: diff.result,\n complete: !!diff.complete,\n dataState: diff.complete ? \"complete\" : \"partial\",\n } as useFragment.Result<TData>; // TODO: Remove assertion once useFragment returns null\n\n if (diff.missing) {\n result.missing = diff.missing.missing;\n }\n\n return result;\n}\n"],"names":[],"mappings":";;AAqFA,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;;AArFA,CAAA,CAAA,CAAA,CAAA,EAAA,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,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;AACA,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;AAkBA,C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,CAAA,CAA6B;QACzB,CAAJ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAa,EAAE,CAAf,CAAA,CAAA,CAAmB,CAAC,CAApB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAA6B,EAAE,CAA/B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAA0C,EAAE,CAA5C,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAqD;IACrD,CAAgC,EAAE,CAAlC,EAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA;IAEE,CAAF,EAAA,CAAM,CAAN,CAAA,CAAA,CAAU,CAAC,CAAX,CAAA,CAAA,CAAA,CAAA,CAAA,CAAkB,EAAE;QAChB,CAAJ,CAAA,CAAA,CAAA,CAAA,CAAU,CAAC,CAAX,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAqB,CAArB,CAAA,CAAA,CAAyB,CAAC,CAA1B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAiC,CAAC,CAAlC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAyC;IACvC;IAEA,CAAF,CAAA,CAAA,CAAA,CAAA,EAAS,CAAT,CAAA,CAAA,CAAA,CAAA,CAAe;AACf;"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import type { ApolloClient, DocumentNode, OperationVariables, TypedDocumentNode } from "@apollo/client";
|
|
1
|
+
import type { ApolloClient, DocumentNode, GetDataState, OperationVariables, TypedDocumentNode } from "@apollo/client";
|
|
2
2
|
import type { MissingTree, Reference, StoreObject } from "@apollo/client/cache";
|
|
3
3
|
import type { FragmentType, MaybeMasked } from "@apollo/client/masking";
|
|
4
|
-
import type { DeepPartial } from "@apollo/client/utilities";
|
|
5
4
|
import type { NoInfer } from "@apollo/client/utilities/internal";
|
|
6
5
|
export declare namespace useFragment {
|
|
7
6
|
interface Options<TData, TVariables> {
|
|
@@ -41,15 +40,13 @@ export declare namespace useFragment {
|
|
|
41
40
|
*/
|
|
42
41
|
client?: ApolloClient;
|
|
43
42
|
}
|
|
44
|
-
type Result<TData> = {
|
|
45
|
-
data: MaybeMasked<TData>;
|
|
43
|
+
type Result<TData> = ({
|
|
46
44
|
complete: true;
|
|
47
45
|
missing?: never;
|
|
48
|
-
} | {
|
|
49
|
-
data: DeepPartial<MaybeMasked<TData>>;
|
|
46
|
+
} & GetDataState<MaybeMasked<TData>, "complete">) | ({
|
|
50
47
|
complete: false;
|
|
51
48
|
missing?: MissingTree;
|
|
52
|
-
};
|
|
49
|
+
} & GetDataState<MaybeMasked<TData>, "partial">);
|
|
53
50
|
}
|
|
54
51
|
export declare function useFragment<TData = unknown, TVariables extends OperationVariables = OperationVariables>(options: useFragment.Options<TData, TVariables>): useFragment.Result<TData>;
|
|
55
52
|
//# sourceMappingURL=useFragment.d.cts.map
|
|
@@ -180,7 +180,7 @@ export declare namespace useLazyQuery {
|
|
|
180
180
|
*/
|
|
181
181
|
previousData?: MaybeMasked<TData>;
|
|
182
182
|
/**
|
|
183
|
-
*
|
|
183
|
+
* A single ErrorLike object describing the error that occured during the latest query execution.
|
|
184
184
|
*
|
|
185
185
|
* For more information, see [Handling operation errors](https://www.apollographql.com/docs/react/data/error-handling/).
|
|
186
186
|
*
|
|
@@ -249,6 +249,10 @@ export declare namespace useLazyQuery {
|
|
|
249
249
|
data: undefined;
|
|
250
250
|
/**
|
|
251
251
|
* Describes the completeness of `data`. - `empty`: No data could be fulfilled from the cache or the result is incomplete. `data` is `undefined`. - `partial`: Some data could be fulfilled from the cache but `data` is incomplete. This is only possible when `returnPartialData` is `true`. - `streaming`: `data` is incomplete as a result of a deferred query and the result is still streaming in. - `complete`: `data` is a fully satisfied query result fulfilled either from the cache or network.
|
|
252
|
+
*
|
|
253
|
+
* @docGroup
|
|
254
|
+
*
|
|
255
|
+
* 1. Operation data
|
|
252
256
|
*/
|
|
253
257
|
dataState: "empty";
|
|
254
258
|
});
|