Skip to content

Commit c8cffe7

Browse files
Version Packages (rc) (#12816)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent e2a0be8 commit c8cffe7

File tree

4 files changed

+154
-3
lines changed

4 files changed

+154
-3
lines changed

.changeset/pre.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
"calm-frogs-remain",
2323
"calm-seals-relate",
2424
"chatty-planes-grin",
25+
"chilly-hairs-kick",
26+
"chilly-kiwis-pretend",
2527
"clean-sheep-hide",
2628
"clean-sloths-travel",
2729
"clever-islands-talk",
@@ -58,6 +60,7 @@
5860
"four-countries-clean",
5961
"four-ghosts-watch",
6062
"four-tables-cheat",
63+
"four-toes-serve",
6164
"fresh-moose-hope",
6265
"fresh-swans-remain",
6366
"friendly-olives-refuse",
@@ -76,7 +79,9 @@
7679
"gold-oranges-double",
7780
"gold-planets-cover",
7881
"gold-sloths-battle",
82+
"gold-worms-compete",
7983
"good-dolphins-peel",
84+
"good-kings-tell",
8085
"gorgeous-chefs-tap",
8186
"great-peaches-design",
8287
"great-roses-jog",
@@ -85,6 +90,7 @@
8590
"healthy-apes-sneeze",
8691
"healthy-books-flash",
8792
"healthy-ghosts-report",
93+
"heavy-files-smash",
8894
"heavy-ways-call",
8995
"hip-vans-act",
9096
"hot-cycles-notice",
@@ -133,6 +139,7 @@
133139
"nice-donkeys-reflect",
134140
"nice-dots-matter",
135141
"nice-waves-work",
142+
"nine-lamps-accept",
136143
"ninety-bags-bake",
137144
"ninety-nails-compete",
138145
"odd-chicken-hide",
@@ -185,8 +192,11 @@
185192
"short-tomatoes-attend",
186193
"shy-experts-cough",
187194
"silent-lobsters-try",
195+
"silent-needles-build",
188196
"silly-knives-exist",
197+
"silly-maps-sit",
189198
"silly-seas-confess",
199+
"silly-starfishes-compare",
190200
"six-jars-fix",
191201
"sixty-bats-cry",
192202
"sixty-bears-bathe",
@@ -198,6 +208,7 @@
198208
"slimy-pots-bow",
199209
"slow-ravens-explain",
200210
"small-buttons-rhyme",
211+
"small-chicken-hear",
201212
"small-cycles-rescue",
202213
"small-kids-film",
203214
"small-poems-rest",
@@ -210,7 +221,9 @@
210221
"sour-guests-poke",
211222
"sour-kids-deliver",
212223
"sour-pillows-guess",
224+
"spotty-days-compete",
213225
"spotty-mugs-poke",
226+
"stale-games-live",
214227
"strange-seahorses-impress",
215228
"strange-walls-march",
216229
"strong-rivers-fry",
@@ -239,14 +252,17 @@
239252
"twelve-mangos-dance",
240253
"twenty-numbers-perform",
241254
"twenty-snakes-sort",
255+
"two-zebras-punch",
242256
"unlucky-kiwis-sell",
243257
"unlucky-sheep-change",
244258
"warm-ties-sit",
259+
"weak-melons-join",
245260
"weak-owls-buy",
246261
"wicked-forks-double",
247262
"wicked-kiwis-buy",
248263
"wicked-queens-lick",
249264
"wild-carpets-exercise",
265+
"wild-tigers-own",
250266
"witty-paws-marry",
251267
"yellow-cats-judge",
252268
"young-moons-admire",

CHANGELOG.md

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

3+
## 4.0.0-rc.7
4+
5+
### Major Changes
6+
7+
- [#12809](https://github.com/apollographql/apollo-client/pull/12809) [`e2a0be8`](https://github.com/apollographql/apollo-client/commit/e2a0be8c3f8b242706f90e0dcc022628992a8ae8) Thanks [@jerelmiller](https://github.com/jerelmiller)! - `operation.getContext` now returns a `Readonly<OperationContext>` type.
8+
9+
- [#12809](https://github.com/apollographql/apollo-client/pull/12809) [`e2a0be8`](https://github.com/apollographql/apollo-client/commit/e2a0be8c3f8b242706f90e0dcc022628992a8ae8) Thanks [@jerelmiller](https://github.com/jerelmiller)! - The `ApolloLink.Request` (i.e. `GraphQLRequest`) passed to `ApolloLink.execute` no longer accepts `operationName` and `operationType` options. These properties are derived from the `query` and set on the returned `ApolloLink.Operation` type.
10+
11+
- [#12808](https://github.com/apollographql/apollo-client/pull/12808) [`8e31a23`](https://github.com/apollographql/apollo-client/commit/8e31a2303b18f6fc4d8ec1cf4c01bf26b90f3f0b) Thanks [@phryneas](https://github.com/phryneas)! - HTTP Multipart handling will now throw an error if the connection closed before the final boundary has been received.
12+
Data after the final boundary will be ignored.
13+
14+
- [#12809](https://github.com/apollographql/apollo-client/pull/12809) [`e2a0be8`](https://github.com/apollographql/apollo-client/commit/e2a0be8c3f8b242706f90e0dcc022628992a8ae8) Thanks [@jerelmiller](https://github.com/jerelmiller)! - `operation.operationType` is now a non-null `OperationTypeNode`. It is now safe to compare this value without having to check for `undefined`.
15+
16+
- [#12809](https://github.com/apollographql/apollo-client/pull/12809) [`e2a0be8`](https://github.com/apollographql/apollo-client/commit/e2a0be8c3f8b242706f90e0dcc022628992a8ae8) Thanks [@jerelmiller](https://github.com/jerelmiller)! - `operation.operationName` is now set as `string | undefined` where `undefined` represents an anonymous query. Previously `operationName` would return an empty string as the `operationName` for anonymous queries.
17+
18+
- [#12809](https://github.com/apollographql/apollo-client/pull/12809) [`e2a0be8`](https://github.com/apollographql/apollo-client/commit/e2a0be8c3f8b242706f90e0dcc022628992a8ae8) Thanks [@jerelmiller](https://github.com/jerelmiller)! - The `concat`, `from`, and `split` functions on `ApollLink` no longer support a plain request handler function. Please wrap the request handler with `new ApolloLink`.
19+
20+
```diff
21+
const link = new ApolloLink(/* ... */);
22+
23+
link.concat(
24+
- (operation, forward) => forward(operation),
25+
+ new ApolloLink((operation, forward) => forward(operation)),
26+
);
27+
```
28+
29+
- [#12809](https://github.com/apollographql/apollo-client/pull/12809) [`e2a0be8`](https://github.com/apollographql/apollo-client/commit/e2a0be8c3f8b242706f90e0dcc022628992a8ae8) Thanks [@jerelmiller](https://github.com/jerelmiller)! - `transformOperation` and `validateOperation` have been removed and are no longer exported from `@apollo/client/link/utils`. These utilities have been merged into the implementation of `createOperation`. As a result, `createOperation` now returns a well-formed `Operation` object. Previously `createOperation` relied on an external call to `transformOperation` to provide a well-formed `Operation` type. If you use `createOperation` directly, remove the calls to `transformOperation` and `validateOperation` and pass the request directly.
30+
31+
- [#12809](https://github.com/apollographql/apollo-client/pull/12809) [`e2a0be8`](https://github.com/apollographql/apollo-client/commit/e2a0be8c3f8b242706f90e0dcc022628992a8ae8) Thanks [@jerelmiller](https://github.com/jerelmiller)! - The request handler provided to `ApolloLink` must now return an `Observable`. `null` is no longer supported as a valid return value. If you rely on `null` so that `ApolloLink` provides an empty observable, use the `EMPTY` observable from RxJS instead:
32+
33+
```diff
34+
import { ApolloLink } from "@apollo/client";
35+
+ import { EMPTY } from "rxjs";
36+
37+
const link = new ApolloLink((operation, forward) => {
38+
- return null;
39+
+ return EMPTY;
40+
});
41+
```
42+
43+
If you have a custom link that overrides the `request` method, remove `null` from the return signature:
44+
45+
```diff
46+
class MyCustomLink extends ApolloLink {
47+
request(
48+
operation: ApolloLink.Operation,
49+
forward: ApolloLink.ForwardFunction,
50+
- ): Observable<ApolloLink.Result> | null {
51+
+ ): Observable<ApolloLink.Result> {
52+
// implementation
53+
}
54+
}
55+
```
56+
57+
- [#12809](https://github.com/apollographql/apollo-client/pull/12809) [`e2a0be8`](https://github.com/apollographql/apollo-client/commit/e2a0be8c3f8b242706f90e0dcc022628992a8ae8) Thanks [@jerelmiller](https://github.com/jerelmiller)! - `createOperation` no longer accepts `context` as the first argument. Instead make sure `context` is set as the `context` property on the request passed to `createOperation`.
58+
59+
```diff
60+
createOperation(
61+
- startingContext,
62+
- { query },
63+
+ { query, context: startingContext },
64+
{ client }
65+
);
66+
```
67+
68+
- [#12809](https://github.com/apollographql/apollo-client/pull/12809) [`e2a0be8`](https://github.com/apollographql/apollo-client/commit/e2a0be8c3f8b242706f90e0dcc022628992a8ae8) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Remove the `TVariables` generic argument on the `GraphQLRequest` type.
69+
70+
- [#12809](https://github.com/apollographql/apollo-client/pull/12809) [`e2a0be8`](https://github.com/apollographql/apollo-client/commit/e2a0be8c3f8b242706f90e0dcc022628992a8ae8) Thanks [@jerelmiller](https://github.com/jerelmiller)! - The context object returned from `operation.getContext()` is now frozen to prevent mutable changes to the object which could result in subtle bugs. This applies to the `previousContext` object passed to the `operation.setContext()` callback as well.
71+
72+
- [#12809](https://github.com/apollographql/apollo-client/pull/12809) [`e2a0be8`](https://github.com/apollographql/apollo-client/commit/e2a0be8c3f8b242706f90e0dcc022628992a8ae8) Thanks [@jerelmiller](https://github.com/jerelmiller)! - The `forward` function passed to the request handler is now always provided to `request` and no longer optional. If you create custom links by subclassing `ApolloLink`, the `forward` function no longer needs to be optional:
73+
74+
```ts
75+
class CustomLink extends ApolloLink {
76+
request(
77+
operation: ApolloLink.Operation,
78+
// This no longer needs to be typed as optional
79+
forward: ApolloLink.ForwardFunction
80+
) {
81+
// ...
82+
}
83+
}
84+
```
85+
86+
As a result of this change, `ApolloLink` no longer detects terminating links by checking function arity on the request handler. This means using methods such as `concat` on a terminating link no longer emit a warning. On the flip side, if the terminating link calls the `forward` function, a warning is emitted and an observable that immediately completes is returned which will result in an error from Apollo Client.
87+
88+
### Minor Changes
89+
90+
- [#12809](https://github.com/apollographql/apollo-client/pull/12809) [`e2a0be8`](https://github.com/apollographql/apollo-client/commit/e2a0be8c3f8b242706f90e0dcc022628992a8ae8) Thanks [@jerelmiller](https://github.com/jerelmiller)! - `ApolloLink`'s `concat` method now accepts multiple links to concatenate together.
91+
92+
```ts
93+
const first = new ApolloLink();
94+
95+
const link = first.concat(second, third, fouth);
96+
```
97+
98+
- [#12809](https://github.com/apollographql/apollo-client/pull/12809) [`e2a0be8`](https://github.com/apollographql/apollo-client/commit/e2a0be8c3f8b242706f90e0dcc022628992a8ae8) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Many of the types exported from `@apollo/client/link` now live on the `ApolloLink` namespace. The old types are now deprecated in favor of the namespaced types.
99+
100+
- `FetchResult` -> `ApolloLink.Result`
101+
- `GraphQLRequest` -> `ApolloLink.Request`
102+
- `NextLink` -> `ApolloLink.ForwardFunction`
103+
- `Operation` -> `ApolloLink.Operation`
104+
- `RequestHandler` -> `ApolloLink.RequestHandler`
105+
106+
- [#12809](https://github.com/apollographql/apollo-client/pull/12809) [`e2a0be8`](https://github.com/apollographql/apollo-client/commit/e2a0be8c3f8b242706f90e0dcc022628992a8ae8) Thanks [@jerelmiller](https://github.com/jerelmiller)! - The static `ApolloLink.concat` method is now deprecated in favor of `ApolloLink.from`. `ApolloLink.concat` is now an alias for `ApolloLink.from` so prefer `ApolloLink.from` instead.
107+
108+
### Patch Changes
109+
110+
- [#12809](https://github.com/apollographql/apollo-client/pull/12809) [`e2a0be8`](https://github.com/apollographql/apollo-client/commit/e2a0be8c3f8b242706f90e0dcc022628992a8ae8) Thanks [@jerelmiller](https://github.com/jerelmiller)! - The individual `empty`, `concat`, `from` and `split` functions exported from `@apollo/client/link` are now deprecated in favor of using the static functions instead.
111+
112+
```diff
113+
import {
114+
ApolloLink,
115+
- concat,
116+
- empty,
117+
- from,
118+
- split,
119+
} from "@apollo/client/link";
120+
121+
- concat(first, second);
122+
+ ApolloLink.concat(first, second);
123+
124+
- empty();
125+
+ ApolloLink.empty();
126+
127+
- from([first, second]);
128+
+ ApolloLink.from([first, second]);
129+
130+
- split(
131+
+ ApolloLink.split(
132+
(operation) => /* */,
133+
first,
134+
second
135+
);
136+
```
137+
3138
## 4.0.0-rc.6
4139

5140
### Major 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.0.0-rc.6",
3+
"version": "4.0.0-rc.7",
44
"description": "A fully-featured caching GraphQL client.",
55
"private": true,
66
"keywords": [

0 commit comments

Comments
 (0)