@apollo/client 4.2.8 → 4.2.10
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 +20 -0
- package/README.md +3 -7
- package/__cjs/cache/inmemory/readFromStore.cjs +1 -4
- package/__cjs/cache/inmemory/readFromStore.cjs.map +1 -1
- package/__cjs/core/ApolloClient.cjs.map +1 -1
- package/__cjs/core/ApolloClient.d.cts +44 -10
- package/__cjs/core/ObservableQuery.cjs +42 -4
- package/__cjs/core/ObservableQuery.cjs.map +1 -1
- package/__cjs/core/ObservableQuery.d.cts +12 -1
- package/__cjs/core/QueryManager.cjs +12 -0
- package/__cjs/core/QueryManager.cjs.map +1 -1
- package/__cjs/core/types.d.cts +2 -0
- package/__cjs/react/hooks/useBackgroundQuery.cjs.map +1 -1
- package/__cjs/react/hooks/useBackgroundQuery.d.cts +92 -47
- package/__cjs/react/hooks/useLazyQuery.cjs.map +1 -1
- package/__cjs/react/hooks/useLazyQuery.d.cts +26 -20
- package/__cjs/react/hooks/useLoadableQuery.cjs.map +1 -1
- package/__cjs/react/hooks/useLoadableQuery.d.cts +23 -15
- package/__cjs/react/hooks/useMutation.cjs.map +1 -1
- package/__cjs/react/hooks/useMutation.d.cts +10 -7
- package/__cjs/react/hooks/useQuery.cjs.map +1 -1
- package/__cjs/react/hooks/useQuery.d.cts +66 -32
- package/__cjs/react/hooks/useQueryRefHandlers.cjs.map +1 -1
- package/__cjs/react/hooks/useSuspenseQuery.cjs.map +1 -1
- package/__cjs/react/hooks/useSuspenseQuery.d.cts +75 -34
- package/__cjs/react/internal/cache/QueryReference.cjs.map +1 -1
- package/__cjs/react/internal/types.d.cts +14 -3
- package/__cjs/react/query-preloader/createQueryPreloader.cjs.map +1 -1
- package/__cjs/react/query-preloader/createQueryPreloader.d.cts +20 -5
- package/__cjs/version.cjs +1 -1
- package/__cjs/version.cjs.map +1 -1
- package/cache/inmemory/readFromStore.js +2 -5
- package/cache/inmemory/readFromStore.js.map +1 -1
- package/core/ApolloClient.d.ts +44 -10
- package/core/ApolloClient.js.map +1 -1
- package/core/ObservableQuery.d.ts +12 -1
- package/core/ObservableQuery.js +42 -4
- package/core/ObservableQuery.js.map +1 -1
- package/core/QueryManager.js +12 -0
- package/core/QueryManager.js.map +1 -1
- package/core/types.d.ts +2 -0
- package/core/types.js.map +1 -1
- package/package.json +1 -1
- package/react/hooks/useBackgroundQuery.d.ts +92 -47
- package/react/hooks/useBackgroundQuery.js.map +1 -1
- package/react/hooks/useLazyQuery.d.ts +26 -20
- package/react/hooks/useLazyQuery.js.map +1 -1
- package/react/hooks/useLoadableQuery.d.ts +23 -15
- package/react/hooks/useLoadableQuery.js.map +1 -1
- package/react/hooks/useMutation.d.ts +10 -7
- package/react/hooks/useMutation.js.map +1 -1
- package/react/hooks/useQuery.d.ts +66 -32
- package/react/hooks/useQuery.js.map +1 -1
- package/react/hooks/useQueryRefHandlers.js.map +1 -1
- package/react/hooks/useSuspenseQuery.d.ts +75 -34
- package/react/hooks/useSuspenseQuery.js.map +1 -1
- package/react/hooks-compiled/useBackgroundQuery.d.ts +92 -47
- package/react/hooks-compiled/useBackgroundQuery.js.map +1 -1
- package/react/hooks-compiled/useLazyQuery.d.ts +26 -20
- package/react/hooks-compiled/useLazyQuery.js.map +1 -1
- package/react/hooks-compiled/useLoadableQuery.d.ts +23 -15
- package/react/hooks-compiled/useLoadableQuery.js.map +1 -1
- package/react/hooks-compiled/useMutation.d.ts +10 -7
- package/react/hooks-compiled/useMutation.js.map +1 -1
- package/react/hooks-compiled/useQuery.d.ts +66 -32
- package/react/hooks-compiled/useQuery.js.map +1 -1
- package/react/hooks-compiled/useQueryRefHandlers.js.map +1 -1
- package/react/hooks-compiled/useSuspenseQuery.d.ts +75 -34
- package/react/hooks-compiled/useSuspenseQuery.js.map +1 -1
- package/react/internal/cache/QueryReference.js.map +1 -1
- package/react/internal/types.d.ts +15 -4
- package/react/internal/types.js.map +1 -1
- package/react/query-preloader/createQueryPreloader.d.ts +20 -5
- package/react/query-preloader/createQueryPreloader.js.map +1 -1
- package/version.js +1 -1
- package/version.js.map +1 -1
|
@@ -372,7 +372,18 @@ export declare class ObservableQuery<TData = unknown, TVariables extends Operati
|
|
|
372
372
|
/**
|
|
373
373
|
* 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/).
|
|
374
374
|
*/
|
|
375
|
-
fetchMore<TFetchData = TData, TFetchVars extends OperationVariables = TVariables>(options: ObservableQuery.FetchMoreOptions<TData, TVariables, TFetchData, TFetchVars>
|
|
375
|
+
fetchMore<TFetchData = TData, TFetchVars extends OperationVariables = TVariables, TErrorPolicy extends ErrorPolicy = "none">(options: ObservableQuery.FetchMoreOptions<TData, TVariables, TFetchData, TFetchVars> & {
|
|
376
|
+
/**
|
|
377
|
+
* Specifies how the query handles a response that returns both GraphQL errors and partial results.
|
|
378
|
+
*
|
|
379
|
+
* For details, see [GraphQL error policies](https://www.apollographql.com/docs/react/data/error-handling/#graphql-error-policies).
|
|
380
|
+
*
|
|
381
|
+
* The default value is `none`, meaning that the query result includes error details but not partial results.
|
|
382
|
+
*
|
|
383
|
+
* @docGroup 1. Operation options
|
|
384
|
+
*/
|
|
385
|
+
errorPolicy?: TErrorPolicy;
|
|
386
|
+
}): Promise<ApolloClient.QueryResult<TFetchData, TErrorPolicy>>;
|
|
376
387
|
/**
|
|
377
388
|
* 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.
|
|
378
389
|
*
|
|
@@ -1000,6 +1000,10 @@ class QueryManager {
|
|
|
1000
1000
|
return (0, rxjs_2.of)({
|
|
1001
1001
|
kind: "N",
|
|
1002
1002
|
value: toResult(data),
|
|
1003
|
+
// Always attach the variables used for this fetch so @export
|
|
1004
|
+
// resolution can update ObservableQuery.options.variables and
|
|
1005
|
+
// resubscribe the cache watch under the correct variable set.
|
|
1006
|
+
resolvedVariables: variables,
|
|
1003
1007
|
source: "cache",
|
|
1004
1008
|
});
|
|
1005
1009
|
};
|
|
@@ -1029,6 +1033,10 @@ class QueryManager {
|
|
|
1029
1033
|
}).then((resolved) => ({
|
|
1030
1034
|
kind: "N",
|
|
1031
1035
|
value: toResult(resolved.data || void 0),
|
|
1036
|
+
// Always attach the variables used for this fetch so @export
|
|
1037
|
+
// resolution can update ObservableQuery.options.variables and
|
|
1038
|
+
// resubscribe the cache watch under the correct variable set.
|
|
1039
|
+
resolvedVariables: variables,
|
|
1032
1040
|
source: "cache",
|
|
1033
1041
|
})));
|
|
1034
1042
|
}
|
|
@@ -1056,6 +1064,10 @@ class QueryManager {
|
|
|
1056
1064
|
exposeExtensions,
|
|
1057
1065
|
}).pipe(validateDidEmitValue(), (0, rxjs_2.materialize)(), (0, rxjs_2.map)((result) => ({
|
|
1058
1066
|
...result,
|
|
1067
|
+
// Always attach the variables used for this fetch so @export
|
|
1068
|
+
// resolution can update ObservableQuery.options.variables and
|
|
1069
|
+
// resubscribe the cache watch under the correct variable set.
|
|
1070
|
+
resolvedVariables: variables,
|
|
1059
1071
|
source: "network",
|
|
1060
1072
|
})));
|
|
1061
1073
|
switch (fetchPolicy) {
|