Migrating to Apollo Client @apollo/client@4.2.0-alpha.2
Version @apollo/client@4.2.0-alpha.2 introduces 2 breaking changes. This guide details how to update your code.
Released: 4/21/2026
⚠️ Check Your Code
If you use any of these symbols, you need to read this guide:
useSuspenseQueryApolloClientApolloClient.DeclareDefaultOptionsApolloClient.DeclareDefaultOptions.WatchQueryApolloClient.DeclareDefaultOptions.QueryApolloClient.DeclareDefaultOptions.MutateApolloClient.TypeOverridesBreaking Changes
●Issue #1
Using `defaultOptions` in the `ApolloClient` constructor without globally declaring the types for those options in `ApolloClient.DeclareDefaultOptions` will now result in a TypeScript error, whereas it was previously valid.
●Issue #2
When using 'modern' signatures (activated by declaring a non-optional property in `DeclareDefaultOptions` or setting `signatureStyle: "modern"`), manually specifying TypeScript generics (e.g., `useSuspenseQuery<MyData>(...)`) will produce a TypeScript error.
Migration Steps
- 1If you use `defaultOptions` in your `ApolloClient` constructor, you must now declare the types for those options globally in `apollo.d.ts` using `ApolloClient.DeclareDefaultOptions` to avoid TypeScript errors.
- 2If you rely on manually specified TypeScript generics for hooks/methods and wish to keep using 'classic' signatures, ensure you do not declare any non-optional properties in `DeclareDefaultOptions` or explicitly set `TypeOverrides { signatureStyle: "classic" }` in `apollo.d.ts`.
Release Summary
Apollo Client 4.2 introduces 'classic' and 'modern' signature styles, enhancing type safety by synchronizing hook/method return types with declared default options. This requires explicit type declaration for used default options to maintain type accuracy.
Need More Details?
View the full release notes and all changes for Apollo Client @apollo/client@4.2.0-alpha.2.
View Full Changelog