Skip to content

Commit 21c354c

Browse files
Version Packages (alpha)
1 parent 51d26ae commit 21c354c

File tree

4 files changed

+59
-3
lines changed

4 files changed

+59
-3
lines changed

.changeset/pre.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"clean-sheep-hide",
1616
"clever-zebras-mate",
1717
"cool-bikes-shake",
18+
"cool-kiwis-hunt",
1819
"cuddly-spiders-tie",
1920
"curvy-pianos-count",
2021
"dirty-eagles-poke",
@@ -27,6 +28,7 @@
2728
"forty-hairs-occur",
2829
"forty-shrimps-fry",
2930
"forty-tomatoes-punch",
31+
"four-countries-clean",
3032
"four-ghosts-watch",
3133
"fresh-moose-hope",
3234
"funny-jeans-invent",
@@ -78,6 +80,7 @@
7880
"rich-eagles-cross",
7981
"rich-kids-carry",
8082
"rude-fans-study",
83+
"seven-dragons-repair",
8184
"seven-foxes-melt",
8285
"shaggy-pugs-add",
8386
"shiny-carrots-invent",

CHANGELOG.md

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

3+
## 4.0.0-alpha.10
4+
5+
### Minor Changes
6+
7+
- [#12557](https://github.com/apollographql/apollo-client/pull/12557) [`51d26ae`](https://github.com/apollographql/apollo-client/commit/51d26ae631c6631a189c98ea9357b18e77a9a876) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Add ability to specify message formatter for `CombinedGraphQLErrors` and `CombinedProtocolErrors`. To provide your own message formatter, override the static `formatMessage` property on these classes.
8+
9+
```ts
10+
CombinedGraphQLErrors.formatMessage = (
11+
errors,
12+
{ result, defaultFormatMessage }
13+
) => {
14+
return "Some formatted message";
15+
};
16+
17+
CombinedProtocolErrors.formatMessage = (errors, { defaultFormatMessage }) => {
18+
return "Some formatted message";
19+
};
20+
```
21+
22+
- [#12546](https://github.com/apollographql/apollo-client/pull/12546) [`5dffbbe`](https://github.com/apollographql/apollo-client/commit/5dffbbe407eb1d9adbcb0fff89f2d3a75dc1ad2b) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Add a static `is` method to error types defined by Apollo Client. `is` makes it simpler to determine whether an error is a specific type, which can be helpful in cases where you'd like to narrow the error type in order to use specific properties from that error.
23+
24+
This change applies to the following error types:
25+
26+
- `CombinedGraphQLErrors`
27+
- `CombinedProtocolErrors`
28+
- `ServerError`
29+
- `ServerParseError`
30+
- `UnconventionalError`
31+
32+
**Example**
33+
34+
```ts
35+
import { CombinedGraphQLErrors } from "@apollo/client";
36+
37+
if (CombinedGraphQLErrors.is(error)) {
38+
console.log(error.message);
39+
error.errors.forEach((graphQLError) => console.log(graphQLError.message));
40+
}
41+
```
42+
43+
### Patch Changes
44+
45+
- [#12557](https://github.com/apollographql/apollo-client/pull/12557) [`51d26ae`](https://github.com/apollographql/apollo-client/commit/51d26ae631c6631a189c98ea9357b18e77a9a876) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Update format of the error message for `CombinedGraphQLErrors` and `CombinedProtocolErrors` to be more like v3.x.
46+
47+
```diff
48+
console.log(error.message);
49+
- `The GraphQL server returned with errors:
50+
- - Email not found
51+
- - Username already in use`
52+
+ `Email not found
53+
+ Username already in use`
54+
```
55+
356
## 4.0.0-alpha.9
457

558
### 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-alpha.9",
3+
"version": "4.0.0-alpha.10",
44
"description": "A fully-featured caching GraphQL client.",
55
"private": true,
66
"keywords": [

0 commit comments

Comments
 (0)