Skip to content

Commit 12960d8

Browse files
authored
Merge branch 'release-4.3' into feat/custom-scalars
2 parents 263f987 + 34018db commit 12960d8

12 files changed

Lines changed: 32 additions & 25 deletions

.api-reports/api-report-core.api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,7 @@ export type InternalRefetchQueriesInclude = InternalRefetchQueryDescriptor[] | R
675675
export type InternalRefetchQueriesMap<TResult> = Map<ObservableQuery<any>, InternalRefetchQueriesResult<TResult>>;
676676

677677
// @public (undocumented)
678-
export interface InternalRefetchQueriesOptions<TCache extends ApolloCache, TResult> extends Omit<ApolloClient.RefetchQueriesOptions<TCache, TResult>, "include"> {
678+
export interface InternalRefetchQueriesOptions<TCache extends Cache_2.Implementation, TResult> extends Omit<ApolloClient.RefetchQueriesOptions<TCache, TResult>, "include"> {
679679
// (undocumented)
680680
include?: InternalRefetchQueriesInclude;
681681
// (undocumented)

.api-reports/api-report-react.api.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
```ts
66

77
import type { ApolloCache } from '@apollo/client/cache';
8-
import type { ApolloCache as ApolloCache_2 } from '@apollo/client';
98
import type { ApolloClient } from '@apollo/client';
109
import type { Cache as Cache_2 } from '@apollo/client/cache';
1110
import type { DataState } from '@apollo/client';
@@ -131,16 +130,16 @@ type MakeRequiredVariablesOptional<TVariables extends OperationVariables, TConfi
131130
} & Omit<TVariables, keyof TConfiguredVariables>>;
132131

133132
// @public @deprecated (undocumented)
134-
export type MutationFunctionOptions<TData = unknown, TVariables extends OperationVariables = OperationVariables, _TContext = DefaultContext, TCache extends ApolloCache_2 = ApolloCache_2> = useMutation.MutationFunctionOptions<TData, TVariables, TCache>;
133+
export type MutationFunctionOptions<TData = unknown, TVariables extends OperationVariables = OperationVariables, _TContext = DefaultContext, TCache extends Cache_2.Implementation = Cache_2.Implementation> = useMutation.MutationFunctionOptions<TData, TVariables, TCache>;
135134

136135
// @public @deprecated (undocumented)
137-
export type MutationHookOptions<TData = unknown, TVariables extends OperationVariables = OperationVariables, _TContext = DefaultContext, TCache extends ApolloCache_2 = ApolloCache_2> = useMutation.Options<TData, TVariables, TCache>;
136+
export type MutationHookOptions<TData = unknown, TVariables extends OperationVariables = OperationVariables, _TContext = DefaultContext, TCache extends Cache_2.Implementation = Cache_2.Implementation> = useMutation.Options<TData, TVariables, TCache>;
138137

139138
// @public @deprecated (undocumented)
140139
export type MutationResult<TData = unknown> = useMutation.Result<TData>;
141140

142141
// @public @deprecated (undocumented)
143-
export type MutationTuple<TData, TVariables extends OperationVariables, _TContext = DefaultContext, TCache extends ApolloCache_2 = ApolloCache_2> = useMutation.ResultTuple<TData, TVariables, TCache>;
142+
export type MutationTuple<TData, TVariables extends OperationVariables, _TContext = DefaultContext, TCache extends Cache_2.Implementation = Cache_2.Implementation> = useMutation.ResultTuple<TData, TVariables, TCache>;
144143

145144
// @public @deprecated (undocumented)
146145
export type OnDataOptions<TData = unknown> = useSubscription.OnDataOptions<TData>;

.api-reports/api-report.api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1701,7 +1701,7 @@ export type InternalRefetchQueriesInclude = InternalRefetchQueryDescriptor[] | R
17011701
export type InternalRefetchQueriesMap<TResult> = Map<ObservableQuery<any>, InternalRefetchQueriesResult<TResult>>;
17021702

17031703
// @public (undocumented)
1704-
export interface InternalRefetchQueriesOptions<TCache extends ApolloCache, TResult> extends Omit<ApolloClient.RefetchQueriesOptions<TCache, TResult>, "include"> {
1704+
export interface InternalRefetchQueriesOptions<TCache extends Cache_2.Implementation, TResult> extends Omit<ApolloClient.RefetchQueriesOptions<TCache, TResult>, "include"> {
17051705
// (undocumented)
17061706
include?: InternalRefetchQueriesInclude;
17071707
// (undocumented)

.changeset/pre.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"@apollo/client-codemod-migrate-3-to-4": "1.0.2"
88
},
99
"changesets": [
10-
"fuzzy-hairs-tie"
10+
"fuzzy-hairs-tie",
11+
"tidy-cache-type-constraints"
1112
]
1213
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@apollo/client": patch
3+
---
4+
5+
Align the remaining cache generic constraints with `Cache.Implementation`. The deprecated React mutation types (`MutationHookOptions`, `MutationFunctionOptions`, `MutationTuple`) and the internal `InternalRefetchQueriesOptions` and `QueryInfo` types still constrained their cache type parameter to `ApolloCache`, so they now match the rest of the overridable cache API.

.size-limits.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"import { ApolloClient, InMemoryCache, HttpLink } from \"@apollo/client\" (CJS)": 47873,
3-
"import { ApolloClient, InMemoryCache, HttpLink } from \"@apollo/client\" (production) (CJS)": 42183,
4-
"import { ApolloClient, InMemoryCache, HttpLink } from \"@apollo/client\"": 35925,
5-
"import { ApolloClient, InMemoryCache, HttpLink } from \"@apollo/client\" (production)": 29449
2+
"import { ApolloClient, InMemoryCache, HttpLink } from \"@apollo/client\" (CJS)": 47998,
3+
"import { ApolloClient, InMemoryCache, HttpLink } from \"@apollo/client\" (production) (CJS)": 42268,
4+
"import { ApolloClient, InMemoryCache, HttpLink } from \"@apollo/client\"": 35960,
5+
"import { ApolloClient, InMemoryCache, HttpLink } from \"@apollo/client\" (production)": 29486
66
}

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# @apollo/client
22

3+
## 4.3.0-alpha.1
4+
5+
### Patch Changes
6+
7+
- [#13268](https://github.com/apollographql/apollo-client/pull/13268) [`419e2b5`](https://github.com/apollographql/apollo-client/commit/419e2b5bfe573d1eb4c3a0ff7aa9084e6aaa2f37) Thanks [@DaleSeo](https://github.com/DaleSeo)! - Align the remaining cache generic constraints with `Cache.Implementation`. The deprecated React mutation types (`MutationHookOptions`, `MutationFunctionOptions`, `MutationTuple`) and the internal `InternalRefetchQueriesOptions` and `QueryInfo` types still constrained their cache type parameter to `ApolloCache`, so they now match the rest of the overridable cache API.
8+
39
## 4.3.0-alpha.0
410

511
### Minor Changes

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@apollo/client",
3-
"version": "4.3.0-alpha.0",
3+
"version": "4.3.0-alpha.1",
44
"description": "A fully-featured caching GraphQL client.",
55
"private": true,
66
"keywords": [

src/core/QueryInfo.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ const queryInfoIds = new WeakMap<QueryManager, number>();
9696
export class QueryInfo<
9797
TData,
9898
TVariables extends OperationVariables = OperationVariables,
99-
TCache extends ApolloCache = ApolloCache,
99+
TCache extends Cache.Implementation = Cache.Implementation,
100100
> {
101101
// TODO remove soon - this should be able to be handled by cancelling old operations before starting new ones
102102
lastRequestId = 1;

0 commit comments

Comments
 (0)