@apollo/client 4.2.2 → 4.3.0-alpha.0
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 +41 -0
- package/__cjs/cache/core/types/Cache.d.cts +5 -2
- package/__cjs/core/ApolloClient.cjs.map +1 -1
- package/__cjs/core/ApolloClient.d.cts +11 -11
- package/__cjs/core/QueryManager.cjs.map +1 -1
- package/__cjs/core/QueryManager.d.cts +4 -4
- package/__cjs/core/deprecated.d.cts +3 -3
- package/__cjs/core/types.d.cts +1 -1
- package/__cjs/react/hooks/useMutation.cjs.map +1 -1
- package/__cjs/react/hooks/useMutation.d.cts +13 -13
- package/__cjs/version.cjs +1 -1
- package/__cjs/version.cjs.map +1 -1
- package/cache/core/types/Cache.d.ts +5 -2
- package/cache/core/types/Cache.js.map +1 -1
- package/core/ApolloClient.d.ts +11 -11
- package/core/ApolloClient.js.map +1 -1
- package/core/QueryManager.d.ts +4 -4
- package/core/QueryManager.js.map +1 -1
- package/core/deprecated.d.ts +3 -3
- package/core/deprecated.js.map +1 -1
- package/core/types.d.ts +1 -1
- package/core/types.js.map +1 -1
- package/package.json +2 -2
- package/react/hooks/useMutation.d.ts +13 -13
- package/react/hooks/useMutation.js.map +1 -1
- package/react/hooks-compiled/useMutation.d.ts +13 -13
- package/react/hooks-compiled/useMutation.js.map +1 -1
- package/version.js +1 -1
- package/version.js.map +1 -1
|
@@ -46,7 +46,7 @@ export declare namespace ApolloClient {
|
|
|
46
46
|
*
|
|
47
47
|
* For more information, see [Configuring the cache](https://www.apollographql.com/docs/react/caching/cache-configuration/).
|
|
48
48
|
*/
|
|
49
|
-
cache:
|
|
49
|
+
cache: Cache.Implementation;
|
|
50
50
|
/**
|
|
51
51
|
* The time interval (in milliseconds) before Apollo Client force-fetches queries after a server-side render.
|
|
52
52
|
*
|
|
@@ -127,7 +127,7 @@ export declare namespace ApolloClient {
|
|
|
127
127
|
*/
|
|
128
128
|
name?: string;
|
|
129
129
|
}
|
|
130
|
-
export type MutateOptions<TData = unknown, TVariables extends OperationVariables = OperationVariables, TCache extends
|
|
130
|
+
export type MutateOptions<TData = unknown, TVariables extends OperationVariables = OperationVariables, TCache extends Cache.Implementation = Cache.Implementation> = {
|
|
131
131
|
/**
|
|
132
132
|
* By providing either an object or a callback function that, when invoked after
|
|
133
133
|
* a mutation, allows you to return optimistic data and optionally skip updates
|
|
@@ -232,7 +232,7 @@ export declare namespace ApolloClient {
|
|
|
232
232
|
export namespace mutate {
|
|
233
233
|
interface DefaultOptions extends ApolloClient.DefaultOptions.Mutate.Calculated {
|
|
234
234
|
}
|
|
235
|
-
type ResultForOptions<TData, TVariables extends OperationVariables, TCache extends
|
|
235
|
+
type ResultForOptions<TData, TVariables extends OperationVariables, TCache extends Cache.Implementation, TOptions extends Record<string, unknown> | MutateOptions<any, TVariables, TCache>> = LazyType<MutateResult<MaybeMasked<TData>, OptionWithFallback<TOptions, DefaultOptions, "errorPolicy"> & ErrorPolicy>>;
|
|
236
236
|
namespace Signatures {
|
|
237
237
|
interface Classic {
|
|
238
238
|
/**
|
|
@@ -243,7 +243,7 @@ export declare namespace ApolloClient {
|
|
|
243
243
|
*
|
|
244
244
|
* It takes options as an object with the following keys and values:
|
|
245
245
|
*/
|
|
246
|
-
<TData, TVariables extends OperationVariables, _INFERENCE_ONLY_DO_NOT_SPECIFY extends "inferred", TErrorPolicy extends ErrorPolicy | undefined = undefined>(options: ApolloClient.MutateOptions<TData, TVariables,
|
|
246
|
+
<TData, TVariables extends OperationVariables, _INFERENCE_ONLY_DO_NOT_SPECIFY extends "inferred", TErrorPolicy extends ErrorPolicy | undefined = undefined>(options: ApolloClient.MutateOptions<TData, TVariables, Cache.Implementation> & {
|
|
247
247
|
errorPolicy?: TErrorPolicy;
|
|
248
248
|
}): Promise<ApolloClient.MutateResult<MaybeMasked<TData>, TErrorPolicy>>;
|
|
249
249
|
/**
|
|
@@ -258,7 +258,7 @@ export declare namespace ApolloClient {
|
|
|
258
258
|
*
|
|
259
259
|
* It takes options as an object with the following keys and values:
|
|
260
260
|
*/
|
|
261
|
-
<TData, TVariables extends OperationVariables = OperationVariables, TCache extends
|
|
261
|
+
<TData, TVariables extends OperationVariables = OperationVariables, TCache extends Cache.Implementation = Cache.Implementation, TErrorPolicy extends ErrorPolicy | undefined = undefined>(options: ApolloClient.MutateOptions<TData, TVariables, TCache> & (TErrorPolicy extends undefined ? {} : {
|
|
262
262
|
errorPolicy: TErrorPolicy;
|
|
263
263
|
})): Promise<ApolloClient.MutateResult<MaybeMasked<TData>, TErrorPolicy>>;
|
|
264
264
|
}
|
|
@@ -271,11 +271,11 @@ export declare namespace ApolloClient {
|
|
|
271
271
|
*
|
|
272
272
|
* It takes options as an object with the following keys and values:
|
|
273
273
|
*/
|
|
274
|
-
<TData, TVariables extends OperationVariables,
|
|
274
|
+
<TData, TVariables extends OperationVariables, TOptions extends ApolloClient.MutateOptions<NoInfer<TData>, NoInfer<TVariables>, Cache.Implementation> & VariablesOption<TVariables & {
|
|
275
275
|
[K in Exclude<keyof TOptions["variables"], keyof TVariables>]?: never;
|
|
276
276
|
}>>(options: TOptions & {
|
|
277
277
|
mutation: TypedDocumentNode<TData, TVariables>;
|
|
278
|
-
}): Promise<ApolloClient.mutate.ResultForOptions<TData, TVariables,
|
|
278
|
+
}): Promise<ApolloClient.mutate.ResultForOptions<TData, TVariables, Cache.Implementation, TOptions>>;
|
|
279
279
|
}
|
|
280
280
|
type Evaluated = SignatureStyle extends "classic" ? Classic : Modern;
|
|
281
281
|
}
|
|
@@ -538,7 +538,7 @@ export declare namespace ApolloClient {
|
|
|
538
538
|
/**
|
|
539
539
|
* Options object for the `client.refetchQueries` method.
|
|
540
540
|
*/
|
|
541
|
-
export interface RefetchQueriesOptions<TCache extends
|
|
541
|
+
export interface RefetchQueriesOptions<TCache extends Cache.Implementation, TResult> {
|
|
542
542
|
/**
|
|
543
543
|
* Optional function that updates cached fields to trigger refetches of queries that include those fields.
|
|
544
544
|
*/
|
|
@@ -988,7 +988,7 @@ export declare namespace ApolloClient {
|
|
|
988
988
|
*
|
|
989
989
|
* It takes options as an object with the following keys and values:
|
|
990
990
|
*/
|
|
991
|
-
function mutate<TData = unknown, TVariables extends OperationVariables = OperationVariables, TCache extends
|
|
991
|
+
function mutate<TData = unknown, TVariables extends OperationVariables = OperationVariables, TCache extends Cache.Implementation = Cache.Implementation>(options: ApolloClient.MutateOptions<TData, TVariables, TCache>): Promise<ApolloClient.MutateResult<MaybeMasked<TData>>>;
|
|
992
992
|
}
|
|
993
993
|
}
|
|
994
994
|
/**
|
|
@@ -999,7 +999,7 @@ export declare namespace ApolloClient {
|
|
|
999
999
|
*/
|
|
1000
1000
|
export declare class ApolloClient {
|
|
1001
1001
|
link: ApolloLink;
|
|
1002
|
-
cache:
|
|
1002
|
+
cache: Cache.Implementation;
|
|
1003
1003
|
/**
|
|
1004
1004
|
* @deprecated `disableNetworkFetches` has been renamed to `prioritizeCacheValues`.
|
|
1005
1005
|
*/
|
|
@@ -1373,7 +1373,7 @@ export declare class ApolloClient {
|
|
|
1373
1373
|
* re-execute any queries then you should make sure to stop watching any
|
|
1374
1374
|
* active queries.
|
|
1375
1375
|
*/
|
|
1376
|
-
refetchQueries<TCache extends
|
|
1376
|
+
refetchQueries<TCache extends Cache.Implementation = Cache.Implementation, TResult = Promise<ApolloClient.QueryResult<any>>>(options: ApolloClient.RefetchQueriesOptions<TCache, TResult>): ApolloClient.RefetchQueriesResult<TResult>;
|
|
1377
1377
|
/**
|
|
1378
1378
|
* Get all currently active `ObservableQuery` objects, in a `Set`.
|
|
1379
1379
|
*
|