Releases: apollographql/apollo-ios
2.0.3
Fixed
- Percent encode semicolons when using GET (#812): Semicolons were not being correctly encoded into the query string when
useGETForQuerieswas enabled. Thank you to @nevil for the contribution. - Include merged fields in selection set equality check (#3602): When a field merged from a child object in a named fragment was merged, it was not being used for equality checks. Equality checks now use the types
__fulfilledFragmentsand collects selections from all of them, instead of just traversing downward fromself.__selections. This ensures all expected data is collected from merged fragments. See PR #832. Thank you to @JOyo246 for raising the issue. - Fixed compilation of initializers for mock objects with custom scalars (#3599): Default values for custom scalars were not compiling due to SPI usage. See PR #838. _Thank you to @akoslowski for raising the issue.
- Fixed infinite loop in parsing invalid multipart messages (#3608): When a multipart message did not end with the correct ending delimiter, the parser would loop over the line infinitely. See PR #839. _Thank you to @frehulfd for raising the issue.
1.25.3
Fixed
- Include merged fields in selection set equality check (#3602): When a field merged from a child object in a named fragment was merged, it was not being used for equality checks. Equality checks now use the types
__fulfilledFragmentsand collects selections from all of them, instead of just traversing downward fromself.__selections. This ensures all expected data is collected from merged fragments. See PR #832. Thank you to @JOyo246 for raising the issue. - Percent encode semicolons when using GET (#812): Semicolons were not being correctly encoded into the query string when
useGETForQuerieswas enabled. Thank you to @nevil for the contribution.
1.25.2
This version has no new changes since v1.25.1 and is being created to fix an issue where the previous version was tagged incorrectly.
2.0.2
1.25.1
1.25.0
Fixed
- Narrowly Scoped
SelectionSetEquality (#3579):SelectionSetequality now uses a narrowly scoped algorithm that only compares fields in the underlying data that are relevant to theSelectionSet. This fixes a bug where a fragment read back from the graph doesn't match one created in memory by ensuring that equality checks for a fragment do not consider fields that are not included in the fragment, even if they are present in the data. Previous equality checks would simply compare the underlyingDataDictdictionary which was incorrect. See PR #771. Thank you to @potrebic for raising the issue.
Note: This change is fixing a long-standing bug in SelectionSet equality, however it may highlight previously hidden equality issues and appear to be a bug. If you're convinced this new equality behaviour exposes a bug please open a new issue and we can discuss it.
2.0.1
2.0.0
Apollo iOS 2.0 is now available! 🎉
Apollo iOS 2.0 represents a complete reimplementation of many components of the library, redesigned from the ground up to take full advantage of Swift's modern concurrency model. This major release introduces significant breaking changes but provides substantial improvements in type safety, performance, and developer experience.
🚀 What's New
- Swift Concurrency First: Complete reimplementation using
async/awaitand structured concurrency - Streamlined APIs: Simplified client APIs with clearer separation of concerns and more precise type safety
- Modern Swift Features: Full adoption of Swift 6 with strict concurrency enabled
- Enhanced Request Chain: New interceptor framework with separate types for different request phases
- Sendable Types: Most types now conform to
Sendablefor improved thread safety
🔧 Major API Changes
- ApolloClient: Complete redesign using
async/awaitinstead of callback-based APIs - Cache Policies: Split into discrete types (
cacheFirst,networkFirst,networkOnly,cacheOnly,cacheAndNetwork) with specific return signatures - Request Interceptors: New framework with
GraphQLInterceptor,HTTPInterceptor,CacheInterceptor, andResponseParsingInterceptortypes - GraphQLResponse: Renamed from
GraphQLResultwith improved generic typing over operations
⚠️ Breaking Changes & Limitations
Minimum Deployment Targets
- iOS 15.0+ (was iOS 12.0+)
- macOS 12.0+ (was macOS 10.14+)
- tvOS 15.0+ (was tvOS 12.0+)
- watchOS 8.0+ (was watchOS 5.0+)
- visionOS 1.0+ (new)
Removed Features
- CocoaPods Support: No longer available. Use Swift Package Manager or XCFrameworks
- Legacy Network Session:
URLSessionClientreplaced withApolloURLSessionprotocol - RequestContext: Replaced with Swift 6
@TaskLocalvalues for dependency injection
Current Limitations
- Web Socket Support: Not available in initial 2.0 release. HTTP subscriptions are supported via
RequestChainNetworkTransport. Web socket support will be added in a future 2.0.x release. - Deprecated APIs: 1.x callback-based APIs are deprecated but still available for incremental migration
📖 Migration Guide
Apollo iOS 2.0 migration follows a two-phase approach:
Phase 1: Breaking Changes
- Update request/response models with code-generation
- Migrate custom
Interceptorsto new discrete types - Update custom
NetworkTransportimplementations - Update custom
NormalizedCacheimplementations
Phase 2: Incremental Updates
- Migrate from deprecated callback APIs to new
async/awaitAPIs - Update cache policies to use new discrete types
- Replace
RequestContextwith@TaskLocalvalues
For detailed migration instructions, see the Apollo iOS 2.0 Migration Guide.
🎯 Recommended Migration Path
- Update dependency to Apollo iOS 2.0
- Re-run code generation with 2.0 engine
- Fix breaking changes (custom interceptors, network transports, etc.)
- Incrementally migrate
ApolloClientusage from callbacks toasync/await - Test thoroughly at each step
1.24.0
New
- Configure cache keys for an operation using the new
@fieldPolicydirective. (#735): Added a new@fieldPolicydirective that can be used to configure cache keys for reading data from the cache prior to making a network request for an operation. Cache keys can also be configured programatically, for more information see documentation here.
Improvement
- Add batching to sqlite selects. (#725): Adding batching to the SQLite select handling to cap the number of parameters at 500 per query.
- Add result code to
SQLiteError. (#755): Adding the raw sqlite result code as an associated value on enum cases ofSQLiteError. - Add
RootSelectionSetconvenience initializer from inline fragment. (#748): Added a convenience initializer toRootSelectionSetthat allows it to be initialized directly from anInlineFragment, simplifying the conversion process between fragments and root entity types. - Make
dependentKeysinGraphQLResultpublic. (#758): MakingdependentKeyspublic allows for implementing customApolloStoreSubscriberssimilar toGraphQLQueryWatcher. Without this it's extremely difficult to know when to react to cache changes for a query. _Thank you to @chrsmys for the contribution.
Fixed
- Duplicate deferred fragment identifiers. (#700): The deferred fragment identifier was being generated using all elements in the deferred fragments path type info array. While the contents of that array are correct because of the unique selection sets, the identifier is able to be shared amongst elements with the same path and defer condition. Taking this into account the identifiers are now generated without duplicates.
- Fix generated default mock initializer for lowercase type names. (#712): Type name in mock initializer of a type with a lowercase name was being inadvertently captialized. Thank you to @dwroth for the contribution.
- Deferred fragment accessor with nested fragment. (#709): The selection set template would correctly produce a fragment accessor property for merged deferred fragments but the initializer was missing.
- Change
clientVersionbuild delimiter. (#721): This changes the version/build delimiter from a-to a+. This now matches the semver specification of that additional metadata.
2.0.0 Beta 3
New
-
Added
@fieldPolicydirective (#766, #749): The@fieldPolicydirective provides new functionality for configuring cache keys for fields with arguments. See the documentation for more information. -
RootSelectionSet Convenience Initializer (#748): Added convenience initializer for
RootSelectionSetfrom inline fragments for easier model construction.
Improved
-
Swift 6 Language Mode (#740): Enabled Swift 6 language mode with strict concurrency checking for improved thread safety and modern Swift patterns.
-
Xcode 26 Support (#756): Updated project configuration and build settings for Xcode 26 compatibility.
Fixed
-
Subscription Over HTTP Support for
RequestChainNetworkTransport(#759): Added subscription support toRequestChainNetworkTransportwith HTTP chunked multipart response handling for GraphQL subscriptions over HTTP. -
Fix Fetch Default Cache Policies (#777): Fixed default cache policy behavior for fetch operations to ensure consistent caching behavior across different operation types.
-
Narrowly Scoped
SelectionSetEquality Checking (#757, #770): Fixed equality checking implementation for generated models in Apollo iOS 2.0 to ensure proper comparison of selection set data. -
CLI Installation (#746): Fixed issues with Apollo iOS CLI installation and distribution.