Skip to content

Commit 00e9054

Browse files
Version Packages (alpha) (#12977)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent d11eb40 commit 00e9054

File tree

4 files changed

+67
-3
lines changed

4 files changed

+67
-3
lines changed

.changeset/pre.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,23 @@
99
"changesets": [
1010
"big-flowers-move",
1111
"cold-kiwis-give",
12+
"famous-hats-explode",
1213
"flat-worms-notice",
1314
"funny-bats-hammer",
15+
"large-ligers-prove",
1416
"little-yaks-decide",
1517
"neat-lemons-shave",
18+
"neat-windows-compete",
19+
"old-singers-eat",
1620
"olive-queens-fold",
1721
"perfect-crabs-smile",
22+
"poor-knives-smile",
1823
"popular-files-glow",
24+
"shaggy-brooms-talk",
1925
"shaggy-islands-yell",
2026
"six-islands-drum",
27+
"slimy-ducks-scream",
28+
"spicy-eels-switch",
2129
"unlucky-cooks-rhyme"
2230
]
2331
}

CHANGELOG.md

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

3+
## 4.1.0-alpha.3
4+
5+
### Minor Changes
6+
7+
- [#12971](https://github.com/apollographql/apollo-client/pull/12971) [`d11eb40`](https://github.com/apollographql/apollo-client/commit/d11eb40aa41d90ac664705bac01158d58bf55e9b) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Add support for `from: null` in `client.watchFragment` and `cache.watchFragment`. When `from` is `null`, the emitted result is:
8+
9+
```ts
10+
{
11+
data: null,
12+
dataState: "complete",
13+
complete: true,
14+
}
15+
```
16+
17+
- [#12971](https://github.com/apollographql/apollo-client/pull/12971) [`d11eb40`](https://github.com/apollographql/apollo-client/commit/d11eb40aa41d90ac664705bac01158d58bf55e9b) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Add support for arrays with `useFragment`, `useSuspenseFragment`, and `client.watchFragment`. This allows the ability to use a fragment to watch multiple entities in the cache. Passing an array to `from` will return `data` as an array where each array index corresponds to the index in the `from` array.
18+
19+
```ts
20+
function MyComponent() {
21+
const result = useFragment({
22+
fragment,
23+
from: [item1, item2, item3],
24+
});
25+
26+
// `data` is an array with 3 items
27+
console.log(result); // { data: [{...}, {...}, {...}], dataState: "complete", complete: true }
28+
}
29+
```
30+
31+
- [#12971](https://github.com/apollographql/apollo-client/pull/12971) [`d11eb40`](https://github.com/apollographql/apollo-client/commit/d11eb40aa41d90ac664705bac01158d58bf55e9b) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Add a `getCurrentResult` function to the observable returned by `client.watchFragment` and `cache.watchFragment` that returns the current value for the watched fragment.
32+
33+
```ts
34+
const observable = client.watchFragment({
35+
fragment,
36+
from: { __typename: "Item", id: 1 },
37+
});
38+
39+
console.log(observable.getCurrentResult());
40+
// {
41+
// data: {...},
42+
// dataState: "complete",
43+
// complete: true,
44+
// }
45+
```
46+
47+
### Patch Changes
48+
49+
- [#12971](https://github.com/apollographql/apollo-client/pull/12971) [`d11eb40`](https://github.com/apollographql/apollo-client/commit/d11eb40aa41d90ac664705bac01158d58bf55e9b) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Deduplicate watches created by `useFragment`, `client.watchFragment`, and `cache.watchFragment` that contain the same fragment, variables, and identifier. This should improve performance in situations where a `useFragment` or a `client.watchFragment` is used to watch the same object in multiple places of an application.
50+
51+
- [#12982](https://github.com/apollographql/apollo-client/pull/12982) [`5c56b32`](https://github.com/apollographql/apollo-client/commit/5c56b3210a2c03e247ec9e600f1e27eb71df5e96) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Ignore top-level `data` values on subsequent chunks in incremental responses.
52+
53+
- [#12982](https://github.com/apollographql/apollo-client/pull/12982) [`5c56b32`](https://github.com/apollographql/apollo-client/commit/5c56b3210a2c03e247ec9e600f1e27eb71df5e96) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Fix the `Defer20220824Handler.SubsequentResult` type to match the `FormattedSubsequentIncrementalExecutionResult` type in `[email protected]`.
54+
55+
- [#12973](https://github.com/apollographql/apollo-client/pull/12973) [`072da24`](https://github.com/apollographql/apollo-client/commit/072da24a8daec3a646ef0cce30de32f95ea0bb23) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Update the `accept` header used with the `GraphQL17Alpha9Handler` to `multipart/mixed;incrementalSpec=v0.2` to ensure the newest incremental delivery format is requested.
56+
57+
- [#12971](https://github.com/apollographql/apollo-client/pull/12971) [`d11eb40`](https://github.com/apollographql/apollo-client/commit/d11eb40aa41d90ac664705bac01158d58bf55e9b) Thanks [@jerelmiller](https://github.com/jerelmiller)! - `DeepPartial<Array<TData>>` now returns `Array<DeepPartial<TData>>` instead of `Array<DeepPartial<TData | undefined>>`.
58+
359
## 4.1.0-alpha.2
460

561
### 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.1.0-alpha.2",
3+
"version": "4.1.0-alpha.3",
44
"description": "A fully-featured caching GraphQL client.",
55
"private": true,
66
"keywords": [

0 commit comments

Comments
 (0)