Change8

Migrating to Apollo Client @apollo/client@4.0.0-alpha.19

Version @apollo/client@4.0.0-alpha.19 introduces 1 breaking change. This guide details how to update your code.

Released: 6/5/2025

1
Breaking Changes
2
Migration Steps
5
Affected Symbols

⚠️ Check Your Code

If you use any of these symbols, you need to read this guide:

ObservableQueryclient.subscribeobservable.restartuseSubscriptioncontext.queryDeduplication

Breaking Changes

Issue #1

Unsubscribing from an `ObservableQuery` before any value is emitted now removes the query from the internal tracked list, meaning it will no longer participate in query deduplication. Code that relied on the query remaining deduplicated after early unsubscribe must be updated to handle the removal or avoid early unsubscribe.

Migration Steps

  1. 1
    If your application unsubscribes from an `ObservableQuery` before any data is received and expects it to stay in the deduplication pool, adjust the logic to either keep the subscription alive or handle the fact that it will be removed.
  2. 2
    To retain the previous behavior of forcing a new connection for a subscription, set `queryDeduplication: false` in the operation's `context`.

Release Summary

Adds subscription restart capability and full‑lifecycle deduplication, while changing early‑unsubscribe behavior for ObservableQuery.

Need More Details?

View the full release notes and all changes for Apollo Client @apollo/client@4.0.0-alpha.19.

View Full Changelog