You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: release-notes.md
+11-12Lines changed: 11 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,12 @@
1
1
# Apollo Client v4.0 Release Notes
2
2
3
-
Apollo Client v4 represents our most significant release yet, featuring comprehensive improvements to error handling, TypeScript support, and developer experience. This release modernizes the codebase while maintaining the powerful GraphQL client capabilities you rely on.
3
+
Apollo Client v4 contains comprehensive improvements to error handling, TypeScript support, and developer experience. This release modernizes the codebase and reduces bundle size while maintaining the powerful GraphQL client capabilities you rely on.
4
4
5
5
## Major Themes
6
6
7
7
### Enhanced Error Handling
8
8
9
-
Apollo Client v4 completely reimagines error handling with a new, more granular error system that replaces the monolithic `ApolloError` class.
9
+
Apollo Client v4 introduces more precise error abstractions that replace the monolithic `ApolloError` class.
10
10
11
11
**Key Changes:**
12
12
-**Specialized Error Classes**: Errors are now categorized into distinct types:
@@ -15,7 +15,6 @@ Apollo Client v4 completely reimagines error handling with a new, more granular
15
15
-`CombinedProtocolErrors` for transport-level errors
16
16
-**Type-Safe Error Handling**: Use `instanceof` checks to handle specific error types
17
17
-**Improved Error Wrapping**: String errors are automatically wrapped in `Error` instances, and non-error objects are wrapped in `UnconventionalError` with a `cause` property
18
-
-**GraphQL over HTTP Spec Compliance**: Full support for `application/graphql-response+json` media type with stricter adherence to the GraphQL over HTTP specification
19
18
20
19
**Migration Example:**
21
20
```typescript
@@ -38,7 +37,7 @@ if (error instanceof CombinedGraphQLErrors) {
38
37
39
38
### TypeScript Improvements
40
39
41
-
Apollo Client v4 delivers substantial TypeScript enhancements that improve type safety and developer experience.
40
+
Apollo Client v4 improves type safety and developer experience through its type definitions.
42
41
43
42
**dataState Type System Overhaul:**
44
43
- The `TData` generic is no longer modified by the `DataState` generic
@@ -61,7 +60,7 @@ Apollo Client v4 delivers substantial TypeScript enhancements that improve type
61
60
62
61
### The New `dataState` Property
63
62
64
-
The `dataState` property is a powerful new addition that provides clear visibility into the completeness of your query results.
63
+
The `dataState` property provides clear visibility into the completeness of your query results.
65
64
66
65
**Values:**
67
66
-`empty`: No data available (`data` is `undefined`)
@@ -89,7 +88,7 @@ if (dataState === 'complete') {
89
88
90
89
### `@defer` Support Evolution
91
90
92
-
Apollo Client v4 introduces a pluggable incremental delivery system for the `@defer` directive.
91
+
Apollo Client v4 introduces a pluggable incremental delivery system for the `@defer` directive. This gives developers the flexibility to define which incremental delivery protocol to use, with the flexibility needed to adapt to any further specification changes.
93
92
94
93
**Pluggable Implementation:**
95
94
- Configure incremental delivery through the `incrementalHandler` option
@@ -106,7 +105,7 @@ Apollo Client v4 introduces a pluggable incremental delivery system for the `@de
106
105
107
106
### Local State Management Enhancements
108
107
109
-
Local state management in Apollo Client v4 has been completely revamped for better reliability and type safety.
108
+
Local state management in Apollo Client v4 has been revamped for modularity, reliability and type safety.
110
109
111
110
**Resolver System Overhaul:**
112
111
- Resolvers have been moved from `ApolloClient` to a new `LocalState` class
-`@apollo/client-graphql-codegen` package for creating resolver types
156
-
- Type-safe resolver development
157
-
- Tailored specifically for `LocalState` usage
154
+
155
+
This release introduces the `@apollo/client-graphql-codegen` package for creating resolver types for GraphQL Code Generator. It is tailored specifically for `LocalState` usage and allows for type-safe resolver development.
158
156
159
157
## Additional Improvements
160
158
@@ -166,7 +164,7 @@ All React-related exports have moved to dedicated entrypoints:
- Note: `gql` should be imported from `@apollo/client`, not from `@apollo/client/react`
168
166
169
-
This change allows core client usage without requiring React as a dependency.
167
+
In previous versions, users sometimes inadvertently imported React modules through seemingly unrelated paths. In v4 we resolve these footguns to make it more transparent when React-only modules are being imported.
170
168
171
169
### Modern Package Format
172
170
@@ -224,6 +222,7 @@ const link = new HttpLink({ uri: '/graphql' });
224
222
- No longer supports Node Streams or Async Iterators as `Response.body`
225
223
- Better abort signal handling
226
224
- WebSocketLink deprecation warning added
225
+
- Full support for `application/graphql-response+json` media type with stricter adherence to the GraphQL over HTTP specification
227
226
228
227
### SSR Improvements
229
228
@@ -250,4 +249,4 @@ For detailed migration guides and examples, visit our documentation at [apollogr
250
249
251
250
## Acknowledgments
252
251
253
-
This release represents months of work from the Apollo Client team and our amazing community. Thank you to all our contributors who helped make Apollo Client v4 the best version yet!
252
+
This release represents years of work from the Apollo Client team and our amazing community. Thank you to all our contributors who helped make v4 possible!
0 commit comments