- Changed the
@available
flags added in 0.23.1 to#if os(macOS)
, since the former is runtime and the latter is compile time, to work around a bug where SwiftUI compiles theApolloCodegenLib
library even if it's not included in the target being previewed. (#1066) - Added support for
omitDeprecatedEnumCases
command line option I missed forApolloCodegenOptions
(#1053)
- Added some
@available
flags to prevent accidental compilation ofApolloCodegenLib
on platforms other than macOS. (#1041) - Made the
Query
onGraphQLQueryWatcher
public so it can be referenced. (#1037)
-
BETA: Now available, SPM-based code generation, Phase 0 of our transition to Swift Codegen.
Note that the underlying codegen is still using
apollo-tooling
, but that will change as we proceed with Phase 1 of the Swift Codegen Project, generating the code in Swift.Documentation is available at our Swift Scripting page.
When this gets to the final version this will supersede existing codegen, so please file bugs galore on this so we can get it good to go as quickly as possible. Thank you! (#940, #1033)\
-
Fixed some memory leaks in our internal Promises implementation. (#1016)
- BREAKING: Updated CLI to v2.22.1, including a bunch of fixes on the Swift side:
- Marked files which are generated as
@generated
- Added documentation to the constructors of input structs
- Added additional type annotations to improve compile times.
- Marked files which are generated as
- BREAKING: Updated delegate in
HTTPNetworkTransport
to be aweak var
and to not be passed in as a parameter to the initializer. (#990, #1002) - Added a lock to
InMemoryNormalizedCache
to reduce possible race conditions. (#552) - Added the ability to not send duplicates on a websocket. (#1004)
- Fixed an issue that could lead to an undefined cache key in the SQLite library. (#991)
- Fixed an issue where existing fetch operations in a watcher would not be canceled before a new one was started. (#1012)
- BREAKING, but by popular request: Removed the requirement that the
clientName
andclientVersion
onNetworkTransport
, and added a default implementation so custom implementations don't need to set these up themselves. (#954)
- Fixed a bunch of data races in
ApolloWebSocket
. (#880) - Updated
ApolloWebSocket
to depend onApollo
inPackage.swift
since there is a dependency there. (#906) - POSSIBLY BREAKING Updated Swift tools verson in package declaration to 5.1. (#883)
- NEW: Added a retry delegate to allow retries based on GraphQL errors returned from your server, not just network-level errors. NOTE: Be careful with which errors you retry for - the mere presence of an error doesn't necessarily indicate a full failure since GraphQL queries can return partial results. (#770)
- NEW: Automatically generates ApolloEngine/ApolloGraphManager headers based on your main bundle's ID and version number. These can also be configured when you set up your
NetworkTransport
if you need something more granular for different versions of your application. (#858) - POSSIBLY BREAKING: The
NetworkTransport
protocol is now class-bound. If you built your ownNetworkTransport
implementation instead of one of the ones included with the library, this now must be aclass
instead of astruct
. (#770) - POSSIBLY BREAKING: Removed an
unzip
method for arrays of arays which we were not using. However, since it was public, we figured we should let you know. (#872) - Bumped Starscream dependency to
3.1.1
. (#873)
- Removes TSAN from run on schemes to fix Carthage issue. (#862)
-
POSSIBLY BREAKING: Updated CLI to no longer be directly bundled, but to be downloaded if needed. This allows us to avoid bloating the iOS repo with the CLI zip, and to make it easier to test different versions of the CLI in the future. This change should automatically download the updated CLI version for you.
Note one significant change from prior bundled versions: If you are connected to the internet when you download the iOS dependency through SPM/Carthage/CocoaPods, you will now need to build your target while still connected to the internet in order to download the proper version of the CLI. Once the correct version of the CLI is downloaded, internet access should no longer be necessary to build. If you disconnect from the internet before the correct version downloads, you will not be able to build. (#855)
-
Updated version of CLI to download to
2.21.0
. (#855) This includes:- Ability to have the codegen ignore deprecated enum cases by using the
--omitDeprecatedEnumCases
flag - Fix for generating input fields for
null
values
- Ability to have the codegen ignore deprecated enum cases by using the
-
Fixes a number of weak references with closures. Note that this may reveal some places you weren't hanging onto a strong reference to your
ApolloClient
object, which will cause it to get deallocated. (#854)
- NEW: Support for Automatic Persisted Queries. This feature allows you to send the hash of a query to your server, and if the server recognizes the hash, it can perform the whole query without you having to send it again. This is particularly useful for large queries, since it can reduce the amount of data you have to send from your user's device pretty significantly. (#767)
- BREAKING: Removed old script files which have been deprecated. If you were still using these, please check out the updated codegen build step setup instructions to get up and running with the
run-bundled-codegen
script. (#820) - POSSIBLY BREAKING: Updated bundled CLI to v2.19.1. Please check out the CLI changelog for full details, but this version actually moves to using multi-line Swift strings for queries. If you prefer to have condensed queries, it also introduces a
--suppressSwiftMultilineStringLiterals
flag which produces single-line queries stripped of whitespace. (#831) - Fixed a couple places we were not using
LocalizedError
properly. (#818)
- Updated the way
run-bundled-codegen
checks whether the bundled codegen has already been unzipped and has node locally. (#806) - Updated how default parameters are provided for
RequestCreatorProtocol
. (#804)
- BREAKING: We've switched to a much simpler setup which does not involve NPM in order to use our CLI. This requires updating your build scripts. Please follow the updated instructions for setting up the build script here. The existing build script will continue to work until the next minor release, at which point it will be removed. (#766)
- Included CLI version fixes issues which showed up in
0.15.2
. - BREAKING: We've removed all public references to our internal
Promise
implementation, which was never intended to be public. (#709) - Fixed a deadlock in a transaction. (#763, #365)
- Added a
RequestCreatorProtocol
to allow you to more easily muck with and/or mock creating multipart requests. (#771) - Fixed an issue causing problems building with SPM in Xcode 11. (#784)
- Revert CLI update from
0.15.2
due to unexpected build issues.
-
Update Apollo CLI requirement to 2.18. This should pull in a couple fixes to the CLI:
- Way better escaping of identifiers, types, and strings (Tooling #1515)
- Fix compiler warning when an optional has a
.none
case (Tooling #1482)
If you run into any weird build issues after this update, try deleting your local
node_modules
folder and rebuilding before filing an issue. (#760) -
Better handling of the
localizedDescription
forHTTPResponseError
. (#756)
- Add platform name to framework bundle identifier to work around a change to app store submission. Please see the PR for more details. (#751)
- Expose the initializer for
GraphQLQueryWatcher
so it can actually be instantiated. (#750)
-
BREAKING: Finally swapped out
URLSessionConfiguration
on initializer forHTTPNetworkTransport
to useURLSession
directly instead. If you were previously passing in a configuration, first hand it to aURLSession
instance and then pass that instance into the initializer.This allows many new things including:
- Support for background sessions
- Easier mocking through
NSURLProtocol
- Certificate pinning
- Self-signed certificates
- Metrics inspection
- Authentication challenge handling
All these are pretty much entirely through the ability to use URLSessionDelegate
directly since we're now accepting a URLSession
you can declare yourself to be the delegate of rather than just the configuration. (#699, inspired by #265)
- BREAKING, though hopefully in a good way: Significant updates to the Upload functionality to make it conform more closely to the GraphQL Upload Spec. Also added a goodly bit of documentation around this functionality. (#707)
- Way better support for Swift Package Manager, especially for
ApolloSQLite
andApolloWebSocket
. (#674) - Created
ApolloClientProtocol
to match all public methods ofApolloClient
for easier mocking. (#715, inspired by #693)
-
BREAKING Updated codegen to use 2.17 of the Apollo CLI. Please see the full release notes for that version of the CLI, but in short:
- Stops force-unwrapping and instead nil-coalesce to
.none
when the thing being unwrapped was a double-optional, which was causing some crashes - Fixes issue where removing redundant modifiers was a little too agressive
- Fixes escaping for
Self
as a type name - Adds
CaseIterable
for all known cases of an enum. If you were adding this yourself previously, you'll have to take it back out. - Adds comment with original operation to
operationDefinition
, stripped excess whitespace from actual definition.
- Stops force-unwrapping and instead nil-coalesce to
-
Added explicit support for Catalyst builds. (#688)
-
Added support for
Int
custom scalars. (#402) -
Exposed
clearCache
directly on stores so a store being used by multiple clients can be more explicitly cleared. (#518) -
Fixed an issue where an error on cache write would not be propagated correctly. (#673)
-
Updated supported Node version to the Long-Term Support version. (#672)
PLEASE READ THESE RELEASE NOTES BEFORE INSTALLING IF YOU WERE USING AN OLDER VERSION!
-
SUPER-BREAKING: Updated a ton of completion closures that could use it to use
Result
instead of optional parameter / optional error. (#644). There are a few details to this one to be particularly aware of:- If you see a bunch of Swift build errors that are claiming Generic Parameter "Query" could not be inferred, that means you need to update your completion closure to take the single
Result<Parameter, Error>
parameter instead of the two (Parameter?
,Error?
) parameters. - Particularly around caching, if there are places where both parameters were
nil
in previous iterations, you will now get anError
. This will generally be aJSONDecodingError.missingValue
, either as the direct error or as theunderlying
error of aGraphQLResultError
. Please check out the changes toFetchQueryTests
in PR #644 for a better look at how some of that has changed.
- If you see a bunch of Swift build errors that are claiming Generic Parameter "Query" could not be inferred, that means you need to update your completion closure to take the single
-
BREAKING: Updated the codegen to use v2.16 of the Apollo CLI. (#647). This is a major version change so some things need to be added, and some parameter names have changed:
- You must add
--target=swift
so the CLI knows to generate Swift code. - If you were using
--schema=schema.json
, use--localSchemaFile="schema.json"
instead (the quotes are required!). - If you were using
--queries="$(find . -name '*.graphql')"
to pass in an array of all your GraphQL files, use--includes=./*.graphql
instead.
If you get error messages about multiple versions of node when you attempt to run, delete the
node_modules
folder in your source root and rebuild.Upgrading fixes several issues:
operationName
is now generated for all operations.- Trailing newlines are now added to all generated files.
- You must add
-
NEW: Ability to upload files according to the GraphQL Multi-part request spec. (#626, #648, inspired by #116)
-
NEW: Now that
operationName
is generated for all operations, we're sending it along with all requests. (#657, inspired by #492) -
NEW: We're also sending
operationName
as theX-APOLLO-OPERATION-NAME
header and when anoperationIdentifier
is provided, sending that as theX-APOLLO-OPERATION-ID
header. (#658) -
NEW: Option to run
VACUUM
on your SQLite store when clearing to help obliterate all traces of data. (#652) -
NEW: Auto-generated API documentation from inline comments. Now available on the website NOTE: Any manual changes made to markdown files will get overwritten, if you want to contribute to the docs, please add inline comments to the code and then I'll get the docs updated. (#642).
-
Made
GraphQLResultError
and its underlying errorpublic
for better error handling. (#655)
- BREAKING: Removed internal
Result
type in favor of Swift's built inResult
type. This allows you to not have to prefix anything that uses the built-in result type withSwift.Result
in places where you're using the Apollo SDK. (#641) - BREAKING: Set strict dependency versions for Starscream and SQLite.swift to prevent potential problems with Swift version conflicts. (#641).
- BREAKING: Made Carthage dependencies for Starscream and SQLite.swift private so they're not automatically pulled in when trying to build just the main SDK with Carthage. If you're using the
ApolloSQLite
orApolloWebSocket
frameworks with Carthage, please read the updated documentation!. (#635, #641) - Fixed issue where
GET
requests were requiringAnyHashable
instead ofAny
which made requests withBool
properties never send. (#628, big thanks to #624)
- Fixed missing
Foundation
imports for several classes that were causing issues with Buck and Swift Package Manager builds. (#620) - Updated version of
SQLite.swift
dependency to one that properly supports Swift 5. (#621) - Whole mess o'documentation updates. (#618)
- Fixed a whitespace issue with one of the build scripts. (#618)
- Made the
GraphQLResult
initializer public for testing. (#544)
- BREAKING: Updated Podspec to preserve paths rather than embedding scripts in the framework. Updated instructions for embedding with CocoaPods. (#575, #610)
- NEW: At long last, the ability to update headers on preflight requests, the ability to peer into what came to the
URLSession
and the ability to determine if an operation should be retried. (#602) - NEW: Added
.fetchIgnoringCacheCompletely
caching option, which can result in significantly faster performance if you don't need the caching. (#551) - NEW: Added support for using
GET
for queries. (#572, #599, #602) - Updated lib and dependencies to use Swift 5, and say so in the Podfile. (#522, #528, #561, #592)
- Exposed a method to ping a WebSocket server to keep it alive. (#422)
- Handling is always done on a handler queue. (#539)
- Added documentation on the
read
andupdate
operations for watching queries. (#452) - Updated build scripts for non-CocoaPods installations to account for spaces in project names or folders. (#610)
- Fixed a code generation fail if you're using MacPorts instead of Homebrew to install
npm
. (#591)
- Disabled bitcode in Debug builds for physical devices (#499)
- Don't embed the Swift standard libraries by default (#501)
- Swift 5 support (#427, #475)
- Update to newest version of Starscream (#466
- Add ability to directly update cache with write methods (#413)
- Add docs for
read
andupdate
operations (#452)
- Add ability to pass params to
Query.Data
(#437) - Provide separate archs for the iOS Simulator (#410)
- Actually install the correct version of Node instead of just checking for it (#434)
- Updated required version of
apollo-cli
to1.9
. A nice addition to1.9.2
is that Swift Enums now conforms to Hashable enabling among other things comparision between fetch objects. (#578) - Fixed internal bug that caused infinite reconnection cycle when connection is lost. A reconnectionInterval was added as a workaround. (#368)
- Fixed internal bug that prevents the
wrongType
case being returned by theJSONDecodingError
implementation ofMatchable
. (#367) - Added delegate for WebTransport which can handle connection/reconnection/disconnection events of websocket. (#379)
- Since
apollo-codegen
is now part of the newapollo-cli
, the build script used to generateAPI.swift
needs to be updated. See the docs for the updated script.
-
Added read and write functions for fine-grained manual store updates.
-
Added support for pluggable asynchronous caches, with an optional experimental SQLite implementation.
-
Fragments are now merged into the parent result, so you only need to go through
fragments
when you want to pass a fragment explicitly. -
Generated result models are no longer immutable (but still obey value semantics).
-
Generated result models now have memberwise initializers (when they represent a concrete type) or type-specific factory methods (when they represent multiple possible types).
-
Any generated result model can be safely initialized from a JSON object (
init(jsonObject:)
and converted into ajsonObject
. -
Generated input objects now differentiate between a property being
null
and a property not being present.