Releases: apollographql/apollo-ios
1.14.0
New
- Experimental support for the
@deferdirective: You can now use the@deferdirective in your operations and code generation will generate models that support asynchronously receiving the deferred selection sets. There is a helpful property wrapper with a projected value to determine the state of the deferred selection set, and support for cache reads and writes. This feature is enabled by default but is considered experimental. Please refer to the documentation for further details. - Add
debugDescriptiontoSelectionSet(#3374): This adds the ability to easily print code generated models to the Xcode debugger console. See PR #412. Thanks to @raymondk-nf for raising the issue. - Xcode 16 editor config files (#3404): Xcode 16 introduced support for
.editorconfigfiles that represent settings like spaces vs. tabs, how many spaces per tab, etc. We've added a.editorconfigfile with the projects preferred settings, so that the editor will use them automatically. See PR #419. Thanks to @TizianoCoroneo for raising the issue.
Fixed
- Local cache mutation build error in Swift 6 (#3398): Mutating a property of a fragment annotated with the
@apollo_client_ios_localCacheMutationdirective caused a compile time error in Xcode 16 with Swift 6. See PR #417. Thanks to @martin-muller for raising the issue.
1.13.0
New
- Added
ExistentialAnyrequirement (#379): This adds the-enable-upcoming-feature ExistentialAnyto all targets to ensure compatibility with the upcoming Swift feature. - Schema type renaming (#388): This adds the feature to allow customizing the names of schema types in Swift generated code.
- JSONConverter helper (#380): This adds a new helper class for handling JSON conversion of data including the ability to convert
SelectionSetinstances to JSON.
Fixed
- ApolloSQLite build error with Xcode 16 (#386): This fixes a naming conflict with Foundation in iOS 18 and the SQLite library. Thanks to @rastersize for the contributon.
1.12.2
Fixed
- Rebuilt the CLI binary with the correct version number: The CLI binary included in the
1.12.1package was built with an incorrect version number causing a version mismatch when attempting to execute code generation.
1.12.1
Fixed
- Rebuilt the CLI binary: The CLI binary included in the
1.12.0package was built with inconsistent SDK versions resulting in the linker signing not working correctly.
1.12.0
New
IDas a custom scalar (#3379): This changes the generation of the built-in GraphQLIDscalar to be treated as a custom scalar that can be modified by the user. See PR #363.
Fixed
- Adds visionOS deployment to ApolloTestSupport podspec (#364): This adds the
visionOSdeployment target to the ApolloTestSupport podspec to match the other package managers. - Add
@_spi(Execution)to executor for import in test mocks (#362): This replaces the use of@testablein ApolloTestSupport with specific@_spiscopes. This resolves a few issues that have been reported where the Apollo module could not be built for testing in non-debug configurations.
1.11.0
New
- Added
refetchOnFailedUpdatesoption toGraphQLQueryWatcher(#347): This allows you to configure the query watcher not to refetch it's query from the server when a cache read to update it's data fails.
Fixed
-
Generated input objects have default
nilvalue for parameters with a schema-defined default value (#2997): When the schema defines a default value for an input parameter, you can now omit that parameter when initializing the input object and the default value will be used. This corrects feature parity with the Apollo Kotlin client. See PR #358. -
Fix namespacing error in
InterfaceTemplate(#3375): This fixes an issue where having a schema type namedInterfacecaused compilation errors in generated code. See PR #359.
1.10.0
New
- Added support for visionOS (#3320): All the dependecies that Apollo iOS requires have been updated to add support for visionOS, so we can now add official support for visionOS too. See PR #333.
Improvement
- Add Sendable conformance to some basic SchemaTypes: This adds
Sendableconformance to the some of the generated schema types. This does not mean that all of the generated code is safe to use yet with complete concurrency checking of Swift 5.10 but it gets us closer to that goal. See PR #322. Thanks to @bdbergeron for the contributon.
preview-defer.2
This preview release has been superseded by release 1.14.0.
This is the second preview release of @defer support in Apollo iOS which focuses on providing early access to using the @defer directive in your operations. During preview releases bugs can occur, if you do experience anything unexpected please report it to us.
Note: Apollo supports a very specific version of the @defer directive proposal as documented here. The @defer directive is still in the proposal stage and is not an official addition to the GraphQL specification yet. This means that Apollo iOS may not work with all servers that currently support @defer.
In this release
- Fixed: If your schema explicitly declared the
@deferdirective then an error about duplicate directives would be thrown during code generation. - Fixed: In some cases the operation metadata for deferred fragments may have been generated with incorrect Swift syntax resulting in a build error.
How to use it
We have a sample schema/server that supports @defer and can be launched using the Docker configuration.
Once you have that service launched you can configure your Apollo iOS client to target the apollo-ios and apollo-ios-codegen dependency packages using the preview-defer.2 tag. Below is an example query using @defer against the schema.
query ExampleQuery {
allProducts {
sku
id
... on Product @defer(label: "additional") {
dimensions {
size
}
variation {
id
name
}
}
}
}
Alternatively here is a sample client to demonstrate the code generation and operation execution of the @defer directive.
Caveats in this preview release
- Caching is intentionally disabled for operations using
@defer.
1.9.3
Fixed
- Fix injecting of context for UploadRequest: Any request context passed into an upload request was not being added to the HTTP request and would not be available to the interceptor chain. See PR (#302). Thanks to @RobertDresler for the contribution.
- Added support for SPM Package.resolved format version 3 (#3355): When using Xcode 15.3 the codegen CLI would fail the
generatecommand with an error stating the Package.resolve file version is unsupported. Version 3 is now accepted as a valid file format for the codegen version checker. See PR (#304). - PrivacyInfo.xcprivacy file is invalid for Apollo and ApolloApi (#3359): We received reports that when submitting to the App Store the submission would fail with an error stating that the privacy manifests were invalid. We identified the error and updated the privacy files. See PR (#309). Thanks to @azilbershtein for raising the issue.
Improvement
- Provide a direct means to observe changes in ApolloStore:
ApolloStorenow exposes it's subscriber mechanism publicly. This means you can now observe and receive notifications about changes to the store. See PR (#300). Thanks to @jamesonwilliams for the contribution. - Remove redundant iteration in EntitySelectionTree merging algorithm: The conditions for merging selections were revisited and we identified, and removed, a redundant iteration. This is a significant performance improvement as it removes an entire additional iteration through all the conditional scopes in the tree. See PR (#308).
1.9.2
Alongside the release of Apollo iOS 1.9.2, we are excited to announce the release of Apollo iOS Pagination! This package works alongside the Apollo iOS Client to make fetching and caching of paginated data a lot easier! Fetching paginated data has always been a pain point with our mobile clients, and an elegant solution for this has been a common feature request for many years. This library is feature rich and highly configurable, so we believe that it will be able to make this previously complex and difficult task a lot easier for our users!
This library supports:
- Reading/Writing paginated data with an Apollo NormalizedCache
- Watching paginated data for changes
- Forward, Reverse, and Bi-directional pagination
- Cursor-based, offset-based, and custom pagination mechanisms
This library is currently released as a 0.x version and is in active development. The API is subject to breaking changes until the stable 1.0 release. We hope that you will check it out and give us your feedback so that we can address any API improvements, edge cases, bugs, or valuable features we hadn’t considered before moving to a 1.0 release soon!
To learn more about Apollo iOS Pagination, see our usage docs.
Fixed
- Backwards Compatibility issues in 1.9.1: 1.9.1 introduced a minor breaking change for some users who were creating a custom implementaiton of
ApolloClientProtocol. Sorry about that! This patch release fixed the compatiblity. See PR #290. Thanks to @michaelloo for raising the issue.
Improvement
- Session and task descriptions parameters added to
URLSessionClient(#286): TheURLSessionClientnow allows you to set asessionDescriptionon the session andtaskDescriptionon each task. These are helpful when debugging, especially when analyzing HTTP traffic with Instruments. Thanks to @hishma for the contribution.