# What changed in @apollo/client

> 329 changes in @apollo/client 4 from its official release notes, upgrade guides and advisories: 265 breaking, 20 deprecations, 19 new APIs and options. Each one cited. Sources checked 2026-10-27. HTML: https://unstale.sh/npm/@apollo/client/

To see which of these apply to a repository, run `npx @unstale/cli init` in it.

## @apollo/client 4

### Breaking changes

- The variables option is required when a fragment has required variables, matching useSuspenseFragment and the query hooks. (4.3.5) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.3.5)
- Field aliases beginning with __ac_ are forbidden because the namespace is reserved for internal use. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- Outgoing requests now default to application/graphql-response+json,application/json;q=0.9 as the Accept header. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration), [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- ApolloClient.addResolvers has been removed; add resolvers through the client's LocalState instance. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration), [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- The core entry point is renamed to @apollo/client. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- The link/core entry point is renamed to @apollo/client/link. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration), [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- React exports move from @apollo/client to @apollo/client/react, requiring React applications to update imports. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration), [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- The render prop components entry point is removed in Apollo Client 4. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- This entry point was removed; use @apollo/client/react instead. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- The higher order components entry point is removed in Apollo Client 4. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- The React hooks entry point is consolidated into @apollo/client/react. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration), [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- The parser entry point is removed along with the render prop components and HOCs it implemented. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration), [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- The testing/core entry point is renamed to @apollo/client/testing. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- The testing/core entrypoint is removed; import from @apollo/client/testing instead. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- The experimental testing entry point is removed; the notes point to @apollo/graphql-testing-library as the available alternative. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration), [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- Internal testing utilities moved here; utilities and types remaining at @apollo/client/testing are now considered stable. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- MockedProvider moved from @apollo/client/testing to this entry point. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- The utilities/globals entry point is removed as an implementation detail; some exports are available in other entry points. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- Most utilities moved to this entry point; utilities and types remaining at @apollo/client/utilities are documented and considered stable. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- The urql subscriptions entry point is removed because urql supports this natively. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration), [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- A type-only migration entry point provides doc blocks for removed exports; importing runtime values from it throws at runtime. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- The clientAwareness option now holds name and version, which move out of the top-level constructor options. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration), [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- Move credentials from the ApolloClient constructor options to the link option, configuring them on an HttpLink instance. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- Certain default options cannot be passed to the constructor unless declared through DeclareDefaultOptions; other defaultOptions remain allowed. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- The connectToDevTools option is replaced by devtools, which contains an enabled property. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- Replace connectToDevTools with devtools.enabled to configure DevTools. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration), [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- Move headers from the ApolloClient constructor options to the link option, configuring them on an HttpLink instance. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- Incremental delivery is configurable and requires an incremental handler; applications using @defer can provide Defer20220824Handler. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration), [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- The link option is now required; ApolloClient no longer creates an implicit HttpLink. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- Configure local state with a LocalState instance and move resolvers into that instance; typeDefs and fragmentMatcher options are removed. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- Rename disableNetworkFetches to prioritizeCacheValues. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration), [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- Move uri from the ApolloClient constructor options to the link option, configuring it on an HttpLink instance. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- uri, headers, and credentials were removed from ApolloClient options; configure HttpLink directly. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- Use declaration merging to declare default errorPolicy and returnPartialData values at the type level, allowing query, mutation, and hook result types to reflect those defaults. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- ObservableQueries are registered only while they have subscribers, so this method returns only queries with at least one subscriber. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- The local resolvers API was removed from ApolloClient in favor of localState. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- Provide a LocalState instance through this constructor option to enable local state management; using @client without it throws an error. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration), [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- ApolloClientOptions is now named ApolloClient.Options; related ApolloClient types are namespaced under ApolloClient. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- Renames disableNetworkFetches; queries made while enabled apply a replacement fetch policy only for that request, without changing the ObservableQuery's original fetchPolicy. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- Only queries with at least one subscriber can be returned or refetched; active and inactive query meanings also changed. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- Removes the resolvers option; configure resolvers in a LocalState instance assigned to localState. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- The resolvers constructor option has been removed; configure local resolvers on the LocalState instance instead. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration), [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- The local resolvers API was removed from ApolloClient in favor of localState. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- The local resolvers API was removed from ApolloClient in favor of localState. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- stop() now unsubscribes active ObservableQuery instances, rejects in-flight queries, and removes queryRefs from the suspense cache. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- ApolloConsumer has been removed; use useApolloClient instead. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- The ApolloError class was removed; errors are no longer universally wrapped in this class. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration), [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- Use the ApolloLink.concat static method instead of the concat function exported from @apollo/client/link. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- Use the ApolloLink.from static method instead of the from function exported from @apollo/client/link. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- The from, concat, and split static and instance methods now require ApolloLink instances; wrap request handler functions in an ApolloLink. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- A request handler must return an Observable; use RxJS EMPTY instead of null for an empty observable. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- Use the ApolloLink.split static method instead of the split function exported from @apollo/client/link. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- execute now requires a third argument containing the client that initiated the request. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- Removes the onError and setOnError methods from ApolloLink. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- The request handler always receives forward, which is no longer optional; calling it from a terminating link warns and returns an immediately completing observable that results in a client error. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- ApolloLink.Request no longer accepts operationName or operationType; those properties are derived from query and set on ApolloLink.Operation. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- FetchResult is now ApolloLink.Result. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- Using an incremental delivery handler now requires explicitly opting into its chunk types through TypeOverrides module augmentation. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- Properties such as called and refetch that are not included in ApolloQueryResult must be read from the hook instead. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- The data field type is now TData | undefined, reflecting its possible runtime value. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- Responses use the specification's application/json behavior; non-200 responses encoded as application/json or another content type now throw ServerError. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- A non-200 response with this content type now throws ServerError. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- The utility was removed; use an RxJS operator such as from to create Observables from promises. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- Removes the base React hook types; use the hook types instead. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- includeExtensions now defaults to true; empty or unset extensions are not included in outgoing requests. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- With no cached data, cache-only queries initialize with loading: false and NetworkStatus.ready. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- Cache-only queries no longer poll; a warning is emitted, and changing to cache-only stops active polling. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- With returnPartialData true and an empty result, cache.diff returns null instead of an empty object; callers and cache implementations must handle or return null. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- With returnPartialData false and an incomplete result, cache.diff returns null instead of throwing; callers and cache implementations must check for or return null. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- fragmentMatches is required, and data masking may crash if it is missing. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- The generic arguments are now ordered TData, TVariables instead of TVariables, TData. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- The option was removed because it caused memory leaks; object identity may differ for objects that were previously referentially equal. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration), [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- client.mutate and useMutation now return MutateResult instead of FetchResult; errors are reported through error rather than errors. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- client.query no longer supports fetchPolicy standby, which does not fetch or return data and is intended for watched queries. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- Document transforms are applied before reading from the cache; use cache.readQuery to read without running transforms. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- cache-only queries are no longer refetched when includeStandby is true. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- Named queries in standby are now refetched; use onQueryUpdated to skip standby queries and retain v3 behavior. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- cache-only queries are excluded from refetchQueries in all situations, including updateCache effects when onQueryUpdated is absent. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- Calling client.subscribe no longer eagerly starts a subscription; subscribe to the returned observable to start it. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- The clientErrors property has no replacement; non-GraphQL and non-protocol errors are passed through as-is. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- ClientParseError was removed; JSON serialization errors are thrown directly. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- GraphQL errors are represented by CombinedGraphQLErrors; use its is method to identify them and read the raw errors property. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration), [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- Protocol errors are encapsulated in CombinedProtocolErrors; use its is method to check an error and read raw protocol errors from the errors property. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- concat, from, and split no longer accept a plain request handler function; wrap it with new ApolloLink. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- Removes the deprecated ApolloClientOptions option; use devtools.enabled instead. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- This testing utility has been removed; use MockLink directly with an ApolloClient instance. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration), [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- createOperation now returns a well-formed Operation; callers should pass the request directly without transformOperation or validateOperation. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- createOperation no longer accepts context as its first argument; put context on the request passed to createOperation. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- disable and retry callbacks now receive a single error property instead of graphQLErrors and networkError. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- The callback response property was renamed to result. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- Applications using data masking need global type augmentation to enable data masking types when dataMasking is true. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- The DataMasking interface is no longer exported from @apollo/client or @apollo/client/masking. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- The data masking types mode has been removed and the mode key has no effect; Masked and MaskedDocumentNode are also removed. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- The DataProxy namespace and interface were removed. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- TContext generic arguments were removed from types that used them and replaced with DefaultContext, which can be modified using declaration merging. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- Applications using @defer need to enable incremental delivery and configure an incrementalHandler. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- HttpLink and BatchHttpLink now send client library name and version in extensions by default; disable transport awareness with enhancedClientAwareness: { transport: false }. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- Errors from results are unified in the error property; remove checks for the errors property. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- Error handling uses a unified error property, granular error classes, and consistent errorPolicy behavior for all error types. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- A class-based replacement for onError; its callback receives a single error property instead of separate GraphQL, network, and protocol error properties. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- Network errors now follow errorPolicy: policies other than none resolve promises, while network-error data is undefined. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- Network errors from queries now adhere to errorPolicy like GraphQL errors; promise-based APIs can resolve with the error property set when policy is ignore. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- Mutation network errors now follow errorPolicy: all resolves the promise and returns the error property, while none strips the error. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- The execute function only accepts variables and context; other options must be provided to the hook, with changed values applied by rerendering before execution. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration), [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- Calling execute during render now throws an error; use useQuery for queries that should execute during render. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration), [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- In-flight queries are aborted when the component unmounts or a new execution starts; call retain on the returned promise to let a query run to completion. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- The promise now resolves or rejects according to errorPolicy for all error types; none rejects, all resolves with error, and ignore resolves while discarding errors. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- Direct calls now require a third argument providing the ApolloClient instance that initiated the request. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- Export fields are validated before requests: they require a matching variable definition, and required variables cannot resolve to null or undefined. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- The package defines an exports field so bundlers resolve module formats through entry points instead of direct .js or .cjs imports. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- Calling fetchMore on a cache-only query now throws an error. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- errorPolicy now defaults to none instead of being inherited, preventing accidental cache writes of partial paginated-query data. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- When query is specified, unspecified options other than variables are inherited from the underlying ObservableQuery. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- Without query, variables are shallowly merged with the underlying ObservableQuery variables; with query, fetchMore variables are used instead. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- The ApolloClient fragmentMatcher option has been removed; fragment matching is now part of the cache through fragmentMatches. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration), [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- Fragment matching is now a cache API; custom cache implementations used with LocalState must implement it. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration), [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- Use the rxjs from function instead of Observable.from. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- The zen-observable utility was removed; use RxJS throwError instead. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- The zen-observable utility was removed; use RxJS from instead. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration), [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- The context function for obtaining cache IDs has been removed; use operation.client.cache.identify instead. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration), [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- ApolloClient.getResolvers has been removed without a replacement. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- Removes the deprecated graphql, withQuery, withMutation, withSubscription, and withApollo HOC components; use React hooks instead. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- graphql v15 is no longer a valid peer dependency. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- The TVariables generic argument was removed from GraphQLRequest. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- An error is thrown if the connection closes before the final boundary; data after the final boundary is ignored. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- Apollo-provided createHttpLink usage migrates to the HttpLink class, instantiated with new. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- includeExtensions now defaults to true; empty or unset extensions are not included in outgoing requests. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- Create and pass an HttpLink through ApolloClient's link option; the uri, headers, and credentials constructor options no longer implicitly create one. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration), [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- The resetResultIdentities option was removed because object canonization was removed. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- The utility was removed; check for the specific error types that replace ApolloError. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- A synchronous link-chain response omits the loading state; an asynchronous response triggers it. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- Thrown local resolver errors are added to the GraphQL response errors array and the field value is set to null. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- Resolvers must return a value or null; undefined becomes null and logs a warning, except for exported-variable resolution. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- Local state is opt-in: create a LocalState instance and pass it as ApolloClient's localState option; move local resolvers into its constructor. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration), [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- A client-only query in a mocked response now throws an error. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- Mocks without a specified delay now use a random realistic delay between 20 and 50ms; set delay to 0 to restore no delay. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration), [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- This testing utility was removed; use MockSubscriptionLink instead. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- This testing utility was removed; use MockLink instead. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- The deprecated Mutation React component was removed; use the provided React hooks instead. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- Network errors are returned as-is rather than wrapped; use the error property directly. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- The newData option was removed from MockLink and MockedProvider mocks; use result as a callback with maxUsageCount set to Number.POSITIVE_INFINITY. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- The option now defaults to true for React hooks and ObservableQuery instances created by client.watchQuery; set the global watchQuery default to false to restore v3 behavior. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration), [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- This is the default incremental delivery handler and throws if @defer is used. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- Observable instances now use rxjs, so instance methods such as map, filter, reduce, flatMap, and concat must be replaced with rxjs equivalents. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- When cache data cannot fulfill a query, its first emitted result is now a loading state. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- Previous data is retained during loading emissions unless the query or variables changed. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- Removes errors from ObservableQuery results and client.query results; read errors from error instead. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- With fetchPolicy set to standby, ObservableQuery returns loading: false even before subscription. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- The saveAsLastResult argument has been dropped. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- Removes getLastResult, getLastError, and resetLastResults from ObservableQuery. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- Removes queryId from ObservableQuery; getObservableQueries now returns a Set rather than a Map. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- ObservableQuery.result() was removed; use RxJS firstValueFrom with the observable instead. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- setOptions was removed as an alias of reobserve; use reobserve directly, which is now public. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- Calling reobserve with variables: undefined resets variables to empty instead of leaving them unchanged. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- The client tracks ObservableQuery instances only while they have subscribers, changing which queries client APIs consider active or inactive and avoiding unnecessary refetches. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- ObservableQuery no longer inherits from Observable; use RxJS from when an API requires an Observable. It still supports subscribe and pipe. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- Network errors no longer emit an error notification or terminate observables; read errors from result.error in the next callback. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration), [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- Unsubscribing while a request is in flight no longer terminates the request by unsubscribing from the link observable. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- Unsubscribing before the first value removes the query from the tracked query list, making it ineligible for query deduplication. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- When notifyOnNetworkStatusChange is true, subscribing emits an initial loading state. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- Use the rxjs of function instead of Observable.of. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- The link callback now reports the cause through a single error property instead of separate GraphQL, network, and protocol error properties. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- The response property in the onError link has been renamed to result. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- Links can access the ApolloClient instance that initiated the request, including its cache. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- The returned context object is now frozen and Readonly. Use operation.setContext() to make changes so they propagate to downstream links. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration), [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- The cache property has been removed from operation context; access the cache through operation.client.cache instead. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration), [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- The forceFetch context property is removed and replaced by queryDeduplication, which indicates whether deduplication was enabled for the request. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- The property is now a non-null OperationTypeNode and can be compared without checking for undefined. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- Use this method to change operation context now that the object returned by operation.getContext() is frozen and Readonly. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- OperationBatcher is no longer exported from @apollo/client/link/batch and should not be used directly. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- Anonymous queries now set operationName to undefined rather than an empty string; check for undefined before using string methods. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration), [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- The package now exposes entry points through the root package.json exports field; proxy-directory package.json files were removed. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- The deprecated partialRefetch option was removed. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- Apollo Client has stopped shipping polyfills; older browsers or special environments may need their own polyfills. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- toPromise moved from queryRef to the preloadQuery function; pass the queryRef to preloadQuery.toPromise, making queryRef objects more serializable for SSR. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration), [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- This SSR API replaces deprecated SSR functions and works with React 19 prerender APIs. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- In useLazyQuery, previousData changes only when data changes; it no longer changes to the same value as data while loading. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- Apollo Client defaults to production rather than development when the environment cannot be determined or globalThis.__DEV__ is not true. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- The loading property was removed from promise-based query API results because promise resolution guarantees the query is no longer loading. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- The networkStatus property was removed from promise-based query API results. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- The partial property was removed from promise-based query API results. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- Queries and mutations now throw an error if the link chain completes without emitting a value. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- The deprecated Query React component was removed; use the provided React hooks instead. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- Subscriptions are deduplicated by default when they qualify; set queryDeduplication to false in the subscription context to create a separate connection. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- The QueryReference type is renamed QueryRef. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration), [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- DataState now modifies the returned TData type; supply unmodified TData and use the third generic to specify allowed data states. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- queryRefs created by preloadQuery no longer have a toPromise function; use preloadQuery.toPromise(queryRef). (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- Support for React 16 was dropped. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- Calling refetch with new variables now sets networkStatus to refetch instead of setVariables. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- reobserve is no longer available in the result returned from useLazyQuery because it was considered an internal API. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- Mocked responses passed to MockLink accept a callback for request.variables; move the callback from variableMatcher to this field. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- Resolver context now nests the request context under requestContext; read request-context properties from that key. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- Resolver context now exposes client, requestContext, and phase; access the cache through client.cache. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- Streaming no longer supports Node Streams, Async Iterators, or Blob response bodies; use a fetch implementation returning a WhatWG ReadableStream. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- The deprecated resultCacheMaxSize option was removed from InMemoryCache options. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- Calling retain on the promise returned by execute lets an in-flight query run to completion despite a later execution or component unmount. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- rxjs replaces zen-observable for Apollo Client's observable implementation and is a new peer dependency to install. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration), [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- RxJS is now a peer dependency and must be installed alongside Apollo Client and graphql. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- The helper is no longer exported; JSON.stringify is used directly. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- ServerError no longer parses response text as JSON; the raw response text is available as bodyText instead of the parsed result property. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration), [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- Migrate from the setContext link to the SetContextLink class because the argument order changed. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- The SetContextLink callback operation argument now uses this type, excludes getContext and setContext, and exposes client. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- The callback arguments are now ordered prevContext, operation; the setContext function is unchanged. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- This method for setting a fragment matcher after client initialization has been removed. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- ApolloClient.setResolvers has been removed without a replacement. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- Queries created with skipToken are excluded from refetchQueries until their first execution, when their variables are known. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- The testing utility was removed from @apollo/client/testing. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- Subscriptions now emit SubscribeResult instead of FetchResult, with error replacing errors. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- The deprecated Subscription React component was removed; use the provided React hooks instead. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- Network errors are subject to errorPolicy; terminating network errors are emitted on next's error property followed by complete. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- Subscription errors are delivered on the result's error property in the next callback rather than the error callback; errors no longer automatically terminate an open connection. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- With errorPolicy ignore, errors no longer emit a result when no data accompanies them. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- Environments must support symbols; add appropriate polyfills where they are unavailable. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- The ApolloClient constructor no longer accepts TCacheShape; remove the generic argument, and APIs that relied on it are now set to unknown. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration), [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- The TContext and TCacheShape generics were removed; custom context types now use module augmentation. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- The TData generic defaults to unknown across APIs that use it. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- The zen-observable utility was removed; use RxJS firstValueFrom instead. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- This utility is no longer exported from @apollo/client/link/utils; its work is incorporated into createOperation. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- Apollo Client targets since 2023, node >= 20, not dead; projects targeting older environments may need to transpile the library or provide polyfills. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- ApolloCache no longer accepts TSerialized; remove the generic argument, and APIs that relied on it are now set to unknown. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration), [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- TVariables now always extends OperationVariables in all interfaces. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- never is no longer a supported generic argument for APIs that require variables; use Record<string, never> instead. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- The typeDefs option was removed from ApolloClient. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- Local resolver objects and arrays for non-scalar fields must include __typename or the field becomes null and an error is added. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- Aliasing another field to __typename is now forbidden. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- GraphQL Codegen masked types require opting in through declaration merging; Apollo Client uses an identity type by default. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- TypeScript variable requirements are stricter, return types are more precise, types are namespaced, and core types are customizable. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- Non-string primitives and non-error-like objects thrown as errors are wrapped in UnconventionalError, with the original value available through cause. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration), [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- The hook no longer accepts context; pass context to the execute function instead. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration), [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- defaultOptions is no longer supported in useLazyQuery options; pass those options directly to the hook instead. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- The deprecated errors property was removed; read errors from error instead. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- The execute function only accepts variables and context, cannot be called during render or SSR, and in-flight queries are automatically cancelled when new ones start. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- The execute promise now resolves to ApolloQueryResult and no longer includes all fields returned by the hook tuple. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- Executing again rejects previously started queries from the same hook usage with AbortError unless retain() is called on their promises. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- The execute promise rejects for GraphQL errors when errorPolicy is none. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- initialFetchPolicy is no longer supported in useLazyQuery options; use fetchPolicy instead. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- The first execute call no longer rerenders with loading state unless notifyOnNetworkStatusChange is true, which is the new default. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- The onCompleted callback was removed from hook options; await the execute promise to perform side effects after completion. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- The onError callback was removed from hook options; handle errors from the execute promise instead. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- The hook no longer accepts variables; pass variables to the execute function instead. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration), [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- useLazyQuery no longer accepts variables or context options; pass them to execute instead. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- useLazyQuery no longer supports SSR and throws if execute is called during SSR; use useQuery for SSR queries. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- After the first execution, option changes no longer trigger network requests; updated options take effect the next time execute is called. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- The ignoreResults option was removed; use client.mutate directly when mutation results do not need to synchronize with component state. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- The mutate function no longer accepts the mutation option. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- React hook behavior and APIs change in Apollo Client 4; the migration notes identify useQuery among the affected hooks. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- The called property was removed from useQuery. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- Removes the defaultOptions option from useQuery; use options directly or ApolloClient global defaultOptions. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- The deprecated errors property was removed; read errors from error instead. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- The onCompleted callback option has been removed from useQuery. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- The deprecated onCompleted and onError callbacks were removed. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- The onCompleted callback was removed from useQuery and useLazyQuery. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- The onError callback option has been removed from useQuery. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- The onError callback was removed from useQuery and useLazyQuery. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- useQuery no longer returns reobserve; rerender the hook with new options instead. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- Most option changes on rerender no longer trigger reobserve or network fetches; query, variables, skip, and fetchPolicy changes to or from standby still do. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- The deprecated callback was removed; use onComplete instead. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- The deprecated callback was removed; use onData instead. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- variables was removed from the result returned from useSubscription. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- This utility is no longer exported from @apollo/client/link/utils; its work is incorporated into createOperation. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- This option has been removed; pass its callback to request.variables instead. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- Passing undefined for a variable replaces it with the query's default value when provided. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- Environments must support WeakMap, WeakSet, and symbols; add appropriate polyfills where they are unavailable. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- Environments must support WeakMap, WeakSet, and symbols; add appropriate polyfills where they are unavailable. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- Apollo Client migrated from zen-observable to RxJS; transformations require pipe and RxJS operators replace method chaining. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)

### Deprecations

- The core entry point is equal to @apollo/client and is slated for removal in the next major; change imports to @apollo/client. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- Provides the namespaced replacement for ApolloClientOptions; the old type remains available but is deprecated. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- Provides the namespaced replacement for QueryOptions; the old type remains available but is deprecated. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- The static method is deprecated in favor of ApolloLink.from, because it is now an alias for ApolloLink.from([a, b]). (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- Provides the namespaced replacement for FetchResult; the old type remains available but is deprecated. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- The bare exported function is deprecated in favor of ApolloLink.concat(). (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- The link creator remains available but is deprecated in favor of the HttpLink class. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration), [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- The link creator remains available but is deprecated in favor of the PersistedQueryLink class. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration), [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- The bare exported function is deprecated in favor of ApolloLink.empty(). (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- The bare exported function is deprecated in favor of ApolloLink.from(). (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- Generated hooks lack the function overloads needed for Apollo Client 4's improved hook type safety; the notes recommend using Apollo Client's hooks directly with TypedDocumentNode and migrating away from generated hooks. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- Provides the namespaced replacement for ApolloQueryResult; the old type remains available but is deprecated. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- The link creator remains available but is deprecated in favor of the ErrorLink class. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- The link creator remains available but is deprecated in favor of the RemoveTypenameFromVariablesLink class. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration), [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- A class-based replacement for removeTypenameFromVariables; the old link creator remains available but is deprecated. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- The link creator remains available but is deprecated in favor of the SetContextLink class. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration), [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- The bare exported function is deprecated in favor of ApolloLink.split(). (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- Provides the namespaced replacement for LazyQueryResult; the old type remains available but is deprecated. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- Provides the namespaced replacement for QueryHookOptions; the old type remains available but is deprecated. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- Provides the namespaced replacement for QueryResult; the old type remains available but is deprecated. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)

### New APIs and options

- This entry point provides pre-compiled React hooks optimized by the React Compiler, with a runtime polyfill for React 17+. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- Add incrementalHandler, configured with a Defer20220824Handler instance, to enable incremental delivery for @defer. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- Static and instance concat methods now accept a dynamic number of link arguments, enabling concatenation of multiple links in one call. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- Query results expose completeness states empty, partial, streaming, and complete for clearer loading distinctions and TypeScript narrowing. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- Declaration merging with DefaultContext lets applications define custom context properties with type safety throughout Apollo Client APIs and links. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- This incremental delivery handler supports the Apollo Router format. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- The errors property provides access to raw protocol errors from a CombinedProtocolErrors instance. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- A class-based replacement for createHttpLink; the old link creator remains available but is deprecated. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- A specific error class is available for link-chain errors and can be checked with its is method. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- Add resolvers after client initialization through the LocalState instance. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- Validation failures throw LocalStateError; use LocalStateError.is to identify them and inspect their GraphQL document path. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- A new network status is set while a deferred query response is streaming; loading remains true until streaming completes. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- Exposes the GraphQL operation type directly on the operation, reducing the boilerplate needed to determine its type for routing. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- The exports field defines available import paths, allowing package-root imports instead of paths such as @apollo/client/index.js or main.cjs. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- A class-based replacement for createPersistedQueryLink; the old link creator remains available but is deprecated. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- ServerParseError is now a proper error class and can be checked with its static is method. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration), [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- TypeOverrides.signatureStyle can select modern or classic method and hook signatures; declaring a non-optional DeclareDefaultOptions property switches automatically to modern signatures. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- A new type marks result data when dataState is streaming and can be overridden to integrate with different codegen dialects. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- Module augmentation configures data masking types and incremental result types; multiple TypeOverrides can be combined. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)

### Behavior and default changes

- DiffResult is now a discriminated union; checking diff.complete narrows result to complete data or DeepPartial<T> | null. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- The global remains a fallback for disabling development mode when build tooling does not support development or production export conditions. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- Development mode is primarily selected by the package exports development condition, which modern bundlers should choose based on the build environment. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- The error property is guaranteed to be an ErrorLike object with message and name properties; thrown non-error-like values are wrapped. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- When true, extensions are still omitted from outgoing requests if extensions is unset or empty. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- MockedProvider now uses realistic delays by default, between 20 and 50 milliseconds. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- Calling refetch guarantees an observable emission, even when the value is deep equal to the previous value. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- Calling setVariables with different variables guarantees an observable emission, even when the value is deep equal to the previous value. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- More features are opt-in to reduce bundle size when they are not used. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- ServerError is now a proper error class and can be checked with its static is method. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)
- Network requests are initiated only when execute is called, so changing hook options does not cause unintended requests; new options apply on the next execution. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)

### Tooling

- A codemod package automates selected Apollo Client 3-to-4 migration changes; it can be run against project files or configured with options such as --codemod. (4.0.0) — [upgrade guide](https://www.apollographql.com/docs/react/migrating/apollo-client-4-migration)

### Fixes and other changes

- Non-JSON-serializable custom scalar values are properly serialized when used as variables or key field values, allowing cache writes and cache.identify calls to succeed. (4.3.5) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.3.5)
- Custom scalar fields in subscription results are parsed when using the no-cache fetch policy. (4.3.5) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.3.5)
- A watch is unregistered when its immediate broadcast throws, preventing an unreachable failing watch from running on later broadcasts. (4.3.4) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.3.4)
- With Defer20220824Handler, dataState stays streaming when incremental errors occur instead of showing completed. (4.3.4) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.3.4)
- Fields whose @defer boundary has not been delivered from the network are no longer reported as missing when writing deferred results. (4.3.4) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.3.4)
- Selections of the same list field with different selection sets are now merged while a @defer boundary is pending, preserving fields included by only one selection. (4.3.4) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.3.4)
- Custom merge functions now receive streamFieldInfo for @stream directives with an aliased field in the path. (4.3.4) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.3.4)
- Fixes a memory leak in isDeferredFragment and isStreamField. (4.3.3) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.3.3)
- Responses with this content type are parsed as well-formed GraphQL responses even when the server returns a non-200 status code. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- Mutations no longer report errors when the server's GraphQL result contains an empty errors array. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- It now resolves with the last emitted result rather than undefined when variables match or the query has no subscribers. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- ServerError and ServerParseError are now proper Error subclasses, so instanceof checks work correctly. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
- previousData advances only when data actually changes. (4.0.0) — [release notes](https://github.com/apollographql/apollo-client/releases/tag/%40apollo/client%404.0.0)
