- Remove all instances of bitcode as not supported in Xcode 14: Starting with Xcode 14, bitcode is no longer required for watchOS and tvOS applications, and the App Store no longer accepts bitcode submissions from Xcode 14. #2398 - Thanks to @stareque-atlassian for the contribution!
- Add codegen option for excludes: There is a new property on the codegen configuration options to allow files matching the pattern to be excluded, in the case they are found in the
includespath. #2205 - Thanks to @bannzai for the contribution! - Fixed - Using the
graphql_transport_wsprotocol could result in4400errors from the server: The correct protocol message is now being sent to the server to end communication. #2320 - Replace
printstatement withCodegenLogger.log: All codegen output is logged withCodegenLoggerwhich can be disabled if needed. #2348 - Thanks to @hiltonc for the contribution! - Expose
GraphQLResultErrorpath string: Adds a new publicly available computed property toGraphQLResultErrorwhich just exposes thepathdescription. #2361 - Thanks to @joshuashroyer-toast for the contribution!
- Fixed - APQ Retrying Failing in 0.51.1: Fixes a bug introduced in the last version that broke APQs. Thanks to Kyle Browning for bringing this to our attention.
- Expose request body creation to better support custom interceptors: Enable lazy access to the request body creation for leverage in custom built interceptors, since JSONRequest.toURLRequest() encapsulates the creation. This enables the GraphQLMap to be accessed without re-creating the body. #2184 - Thanks to Rick Fast for the contribution.
- Allow periods in arguments to be ignored when parsing cacheKeys: If your query arguments include periods they will no longer cause broken cache keys. This means the cached data for those queries can be correctly found and returned. The caveat with this change though is that if you use a persisted cache, after the upgrade you could see cache misses and the data would be refetched. #2057 - Thanks to Hesham Salman for the contribution.
- Fixed -
SendableclassJavaScriptErrorcannot inherit from another class other thanNSObject: Xcode 13.3 introduced some additional requirements forErrortypes andJavaScriptErrordid not conform causing compile errors inApolloCodegenLib. This change disablesSendabletype checking forJavaScriptErrorwhile maintaining type-safety across concurrency boundaries. #2147 - Thank you to Tiziano Coroneo for the contribution. - Fixed - Watcher using a policy that shouldn't hit the network, can still hit the network: If the cache policy given to the
watch(query:cachePolicy:)method ofApolloClientwas.returnCacheDataDontFetchit could still trigger a remote fetch of the query. - Thank you to Peter Potrebic for raising the issue. - BREAKING CHANGE -
graphql-wsProtocol Support: We've added official support for the graphql-ws library and itsgraphql-transport-wsprotocol. This is a breaking change because theWebSocketinitializers now require you to specify which protocol to use.
- Dropped SPM support for Swift 5.2: The minimum version of the Swift tools and language compatibilty required to process the SPM manifest is Swift 5.3. This means a minimum of Xcode version 12 is required for Swift Package Manager support. #1992
- Removed unnecessary assertion failure: The completion handler on
returnResultAsyncIfNeededis defined as optional but if not included would cause debug builds to crash with anassertionFailurein the case of afailureof theResult. #2005 - Thank you to Richard Topchii for raising this issue! CachePolicy.defaultis now a stored property: It is now easier to configure a different default value for theCachePolicyproperty on anyApolloClientinstance instead of having to override it in a subclass. #1998 - Thank you to Tiziano Coroneo for the contribution!- Exposed
cacheKeyfunction aspublic: The access modifier of this function onGraphQLFieldhas changed frominternaltopublic. It is not recommended to rely on internal behaviour of the cache, and this is subject to change in future major versions. #2014 - Thank you to Peter Potrebic for the discussion! - GET method support for
ApolloSchemaDownloader: Introspection-based schema downloads can now be queried using a GET request. #2010 - Thank you to Mike Pitre for the contribution! - Updated to version 2.33.9 of the Apollo CLI: This update will add
__typenamefields to inline fragments in operations to match the output from theclient:pushCLI command which used for operation safelisting. This should not affect the behaviour of your operations. #2028. - Updated to version 0.13.1 of SQLite.swift: This update brings in some iOS 14 fixes and new table functionality such as
upsertandinsertMany. #2015 - Thank you to Hesham Salman for the contribution.
ApolloSchemaDownloadConfiguration.HTTPHeaderinitializer was not public: The struct initializer that Swift automatically generates is marked with theinternalaccess level, which meant that custom HTTP headers could not be added to an instance ofApolloSchemaDownloadConfiguration. #1962 - Thank you to Nikolai Sivertsen for the contribution!- Documentation update: Fixed an inline code block that had specified language where such specification is not supported. #1954 - Thank you to Kim Røen for the contribution!
- Fix - ApolloCodegenOptions could not find schema input file: - If you created
ApolloSchemaDownloadConfigurationandApolloCodegenOptionsobjects using only output folders the default output filename for the schema download was different from the default schema input filename for codegen. #1968 - Thank you to Arnaud Coomans for finding this issue!
- Breaking - Schema download is now Swift-based: The dependency on the Apollo CLI (Typescript-based) for schema downloading has been removed. Schema downloading is now Swift-based, outputs GraphQL SDL (Schema Definition Language) by default, and is maintainable/extensible within apollo-ios with full API documentation. This is a breaking change because some of the API signatures have changed. Swift scripting offers a convenient way to perform certain operations that would otherwise require the command line - it's worth a look if you haven't tried it yet. #1935
- Customizable subscription message identifiers: The
WebSocketTransportinitializer can be configured with a subclass ofOperationMessageIdCreatorto provide a unique identifier per request. The default implementation isApolloSequencedOperationMessageIdCreatorand retains the current behavior of sequential message numbering. #1919 - Thank you to Clark McNally for the contribution! - AWS AppSync Compatibility: Apollo-ios will now correctly handle the
start_ackmessage that AWS AppSync servers respond with when a subscription is requested. #1919 - Thank you to Clark McNally for the contribution! - Updated to version 2.33.6 of the Apollo CLI: Applies some new vulnerability patches to the CLI, but should not change any output. #1929
- Improved documentation: Clarification of cache normalization concepts. #1710 - Thank you to Daniel Morgan for the contribution!
- Fixed - Websocket default implementation not included in
ApolloWebSocketvia Cocoapods: Thank you to ketenshi for the contribution!
- Breaking - Removed Starscream dependency: Due to dependency management conflicts it has become easier for us to maintain our WebSockets as part of the
ApolloWebSocketstarget instead of an external dependency on a forked version of Starscream. #1906- Removed Starscream as an external dependency in Cocoapods and Swift Package Manager.
- The
DefaultWebSocketimplementation has been replaced withWebSocket.
- Fixed -
clearCachenot using the provided callback queue:ApolloClientwas not passing the provided callback queue toApolloStoreand therefore the completion block forclearCachewas being called on the main queue. #1904, #1901 - Thank you to Isaac Ressler for the contribution! - Removed - Swift playground: The playground has been moved to a separate repository. #1905
- Removed - Swift experimental codegen: The experimental Swift code generation has been removed from
mainand will instead become available in therelease/1.0-alpha-incubatingbranch until a 1.0 release. #1873 - Fixed - Query watcher not being called when the cache is updated on an element by another query/subscrition/mutation: The long-term solution is to integrate web sockets into the request chain but this is an interim fix that allows
WebSocketTransportto be configured with a store to update the cache when receiving data. This should not break any workarounds others have already implemented. #1889, #1892 - Thank you to tgyhlsb for the contribution!
- Breaking - Downgraded from Starscream v4 to v3! After upgrading to Starscream 4.0, a lot of our users started to experience crashes while using web sockets. We've decided to revert to the more stable Starscream version 3. In order to fix a few known bugs in Starscream 3, we have made a fork of Starscream that Apollo will depend on going forward. In preparation for moving to Apple WebSockets in the future, we have also fully inverted the dependency on Starscream. Between these two changes, a lot of breaking changes to our Web Socket API have been made:
- The
ApolloWebSocketClientprotocol was removed and replaced withWebSocketClient. WebSocketClientdoes not rely directly on Starscream anymore and has been streamlined for easier conformance.ApolloWebSocket, the default implementation of theWebSocketClienthas been replaced withDefaultWebSocket. This implementation uses Starscream, but implementations using other websocket libraries can now be created and used with no need for Starscream.WebSocketClientDelegatereplaces direct dependency onStarscream.WebSocketDelegatefor delegates.
- The
- Breaking: Renamed some of the request chain interceptors object:
LegacyInterceptorProvider->DefaultInterceptorProviderLegacyCacheReadInterceptor->CacheReadInterceptorLegacyCacheWriteInterceptor->CacheWriteInterceptorLegacyParsingInterceptor->JSONResponseParsingInterceptor
- Breaking:
WebSocketTransportis now initialized with anApolloWebSocket(or other object conforming to theApolloWebSocketClientprotocol.) Previously, the initializer took in the necessary parameters to create the web socket internally. This provides better dependency injection capabilities and makes testing easier. - Removed class constraint on
ApolloInterceptorand converted to structs for all interceptors that could be structs instead of classes. - Added
removeRecords(matching pattern: CacheKey)function to the normalized cache.
- BREAKING: Split
ApolloCoreinto two more granular libraries,ApolloAPI(which will contain the parts necessary to compile generated code) andApolloUtils(which will contain code shared betweenApolloandApolloCodegenLib). If you were previously importingApolloCore, in most places you will need to importApolloUtils. If you're using Carthage, you will need to remove the oldApolloCorexcframework and replace it with the twoApolloAPIandApolloUtilsframeworks. (#1817) - Fixed a stray CocoaPods warning. (#1769)
- Updated the Typescript CLI to version 2.32.13. (#1773)
- Added the ability to specify a
cachePolicywhen callingrefreshon aGraphQLWatcher. (#1802)
- BREAKING (or hopefully, fixing): We removed our test libraries from our
Package.swiftfile since we're not using it to run tests directly at this time. This prevents SPM from trying to resolve test dependencies that are not actually used in the library, which should reduce any version conflicts. However, if you were using any of our test libs in an unsupported fashion, these will no longer be directly available. (#1745) - Fixed an issue where when
Starscreamreturned multiple errors in close succession, an exponential number of web socket reconnections could be created. (#1762) - Updated
classconstraints toAnyObjectconstraints, which should silence a few warnings in 12.5 and be more forward compatible. (#1733) - Added the ability to specify a callback queue for the result handler of
GraphQLWatcher. (#1723) - Fixed a crash when closing a web socket connection and re-opening it immediately. (#1740)
- You can now skip auto-reconnection for updating the header values and connecting payload in
ApolloWebSocket. (#1759) - Now avoids the
?when generating aGETURL ifqueryItemsis empty. (#1729) - Updated use of the
defaultfetch policy to include fetch and watch. Note that under the hood, this does not change what fetch policy was pointed to at this time, it just centralizes the logic. (#1737)
- BREAKING: Finally updates our
Starscreamdependency to 4.0.x. Note that due to SOCKS proxy support being removed fromStarscream, we've correspondeingly removed such support.(#1659) - BREAKING, but only to Swift Scripting: Updated
ApolloSchemaOptionsto more clearly handle introspection (ie, from a URL) vs registry (ie, from Apollo Studio) requests by using an enum. If you were passing in anendpointURLpreviously, you need to use the.introspectionenum value going forward. Also changed the name of the field to match the new type. (#1691) - BREAKING: Removed
CoadableParsingInterceptorand related code designed for new codegen (which is still in progress) since we were wildly over-optimistic on how quickly we'd be using it. (#1670) - Fixed an issue where tasks that were in the
cancelingstate could trigger aNo data found for taskassertion failure. (#1677) - Fixed an issue with encoding
+inGETrequests. (#1653) - Fixed an issue where creating
GETrequests removed existing query params from the URL. (#1687) - Prevented a retain cycle during web socket reconnection. (#1674)
- Added better handling for calling
cancelon aRequestChainwhich has already been cancelled. (#1679)
- BREAKING: Fixed an issue in which
UploadRequestswere not getting headers added via theRequestChainNetworkTransport'sadditionalHeaders. Please note that if you've subclassed the RCNT, you'll need to update your overrides since we had to add a parameter. (#1644) - Stopped
GETrequests from sending aContent-Typeheader, which could cause servers not configured to ignore that header when the body is empty to freak out. (#1649)
- BREAKING: Dropped support for iOS/tvOS < 12, watchOS < 5, and macOS < 10.14. This also involved removing a couple of public functions that were workarounds for support for lower versions. (#1605)
- Updated the typescript CLI to version
2.32.1. There may be some structural changes to generated code but it should not actually break anything. Please file bugs immediately if it does. (#1618)
- POSSIBLY BREAKING: Updated
swift-toolsversion to 5.3, and added a fallback version ofPackage.swiftfor 5.2. (#1584) - BREAKING, technically: Switched
cachePolicyto avaronHTTPRequest. This makes it possible for retries to use a different cache policy, such as when an error has occurred at the network level and you want to fall back to showing what's in the cache without retrying the network call. (#1569) - Added validation in Swift Codegen wrapper that a URL passed in for
singleFilecode generation is a.swiftfile and a URL passed in formultipleFilescode generation is a folder. (#1580)
- Fixes an issue that could cause callbacks to fail if a
retrywas performed in anadditionalErrorInterceptor. (#1563)
- Updates a dependency used for Experimental Swift Codegen to use a version to fix an issue with resolution failures
- Updates
apollo-toolingversion to include a bugfix there. (#1554)
- BREAKING: We've made some significant (~4x) performance improvements to the cache and eliminated all our known Thread Sanitizer issues by removing some overly agressive multithreading and our internal Promises implementation. (#1531) Related Changes:
- POSSIBLY BREAKING: These improvements caused changes in our
NormalizedCacheandApolloClientProtocolprotocols, so if you're implementing these yourself, you'll need to update. - BREAKING: Removed the
loadRecords(forKeys:)method onReadTransaction. We'd recommended that you use eitherreadorreadObjectwith the transaction, but if you were usingloadRecords, you will need to shift to those other methds. - NEW:
ApolloStore'sload(query:resultHandler:)method now also takes an optional callback queue.
- POSSIBLY BREAKING: These improvements caused changes in our
- NEW: Added the ability to say whether the results from a mutation should be published to the store are not. This is a boolean value which defeaults to
true, to match existing behavior. (#1521) - BREAKING: The setter for
Atomic'svalueis no longer public to prevent accidental misuse. If you were using this, use themutatemethod instead to ensure the thread lock works properly. (#1538)
- POSSIBLY BREAKING: Updated behavior of
URLSessionClientwhen it's been invalidated to throw an error instead of crashing. If you were relying on this failing loudly before, please be aware it's going to fail a lot more quietly now. (#1489) - Improved performance of
loadRecordsfor the SQLite cache. (#1519) - Added support for use of
Apolloas a dynamic lib. (#1483) - Updated the legacy CLI to
2.31.0. (#1510) - Fixed some bugs in our
JSONSerializationhandling. (#1478) - Fixed an issue with callback queue handling for websockets. (#1507)
- Fixed an issue with callback queue handling for errors. (#1468)
- Removed a redundant
nilcheck while clearing the cache. (#1508)
- POSSIBLY BREAKING: We removed some default parameters for the
ApolloStorefromApolloClientandLegacyInterceptorProviderto prevent an issue where developers could accidentally create these objects with different caches. (#1461) - Added a new parameter to allow the option to not automatically connect a websocket on initialization. (#1458)
- BREAKING: Removed the now-unused-in-the-SDK
GraphQLHTTPResponseErrortype. If you were relying on this class, please copy it out of v0.34.1. (#1437) - BREAKING: Removed default parameters from
RequestBodyCreator's default implementation to fix an issue where when default parameters were passed, the compiler would always select the default implementation even if a full alternate implementation was provided. (#1450) - Removed unnecessary manual task clearing when invalidating a URLSession. (#1443)
- Fixes an issue that would cause headers to get lost when sending with
useGETForQueries. (#1420)
- SPECTACULARLY BREAKING: As noted in the Beta release notes below, the networking stack for HTTP requests has been completely rewritten. This is described in great detail in the RFC for the networking changes, as well as the updated documentation for Advanced Client Creation and the updated tutorial section on setting up authentication. Thank you all for the excellent feedback and looking forward to hearing about the cool stuff you're able to build with this! (#1386)
- REMINDER: If you're using Carthage with Xcode 12, please make sure you're using the workaround script as outlined in the release notes for
0.33.0.
Networking Stack, Release Candidate
- Made
RequestChainNetworkTransportsubclassable and changed two methods to beopenso they can be subclassed in order to facilitate using subclasses ofHTTPRequestwhen needed. (#1405) - Made numerous improvements to creating upload requests - all upload request setup is now happening through the
UploadRequestclass, which is nowopenfor your subclassing funtimes. (#1405) - Renamed
RequestCreatortoRequestBodyCreatorto more accurately reflect what it's doing (particularly in light of the fact that we didn't have aRequestin the old networking stack, and now we do), and renamed associated properties and parameters. (#1405)
Networking Stack, Release Candidate
-
Added some final tweaks:
- Updated
ApolloStoreto take a default cache of theInMemoryNormalizedCache. - Updated LegacyInterceptorProvider to take a default store of the
ApolloStorewith that default cache. - Added a method to
InterceptorProviderto provide an error interceptor, along with a default implementation that returnsnil. - Updated
JSONRequestto be open so it can be subclassed.
This is now at the point where if there are no further major bugs, I'd like to release this - get your bugs in ASAP! (#1399
- Updated
Networking Stack, Beta 2
- Merges
0.33.0changes into the networking stack for Swift 5.3 and Xcode 12.
- Adds support for Xcode 12 and Swift 5.3. (#1280)
- Adds workaround script for Carthage support in Xcode 12. Please see Carthage-3019 for details. TL;DR: cd into
[YourProject]/Carthage/Checkouts/apollo-ios/scriptsand then run./carthage-build-workaround.shto actually get Carthage builds that work. (#yolo committed tomain)
Networking Stack, Beta 1
- SPECTACULARLY BREAKING: The networking stack for HTTP requests has been completely rewritten. This is described in great detail in the RFC for the networking changes, as well as the updated documentation for Advanced Client Creation. Please, please, please file bugs or requests for clarification of the docs as soon as possible. Note that all changes until the networking stack comes out of beta will live on the
betas/networking-stackbranch. (#1341)
- Improves invalidation of a
URLSesionClientto include cancellation of in-flight operations. (#1376)
- Fixes an issue that would occur when a GraphQL query watcher's dependent keys would not get updated. (#1375)
- Adds an
extensionsdictionary property toGraphQLResult. (#1370) - Makes a couple of response parsing helpers public for advanced use cases. (#1372)
-
Adds the ability to pause and resume a WebSocket connection without dumping existing subscriptions. (#1335)
-
Adds an initializer to
SQLiteNormalizedCachethat takes aSQLite.swiftDatabaseConnectionto more easily allow setup of pre-configured connections. (#1330) -
Addresses a retain cycle that could cause memory leaks when using multiple instances of
HTTPNetworkTransport.NOTE: If you're using
URLSessionClientoutside the context ofHTTPNetworkTransport, make sure to callinvalidate()on it when whatever is holding onto it hitsdeinit()to prevent leaks. (#1366)
- BREAKING: Updates the CLI to
2.30.1to fix a long-standing issue where when generating operation IDs and their related JSON file, the correct operations + fragments would be used in generating the operation ID, but not output with the JSON file. This will slightly change the output inAPI.swift, but it also means we can remove a related workaround from the iOS SDK. (#1316) - BREAKING: Removed the
Cartfilewhich declared our dependencies, since we're now internally managing them with SPM, and newer versions of Carthage just use the SPM dependencies. Note that this can cause issues if you need to use a fork of dependencies, or if you're using an older version of Carthage. (#1311) - POSSIBLY BREAKING: Works around an issue that could cause some attempts to store untyped JSON dictionaries to throw unexpected errors about optional encoding. This also added handling of creating a dictionary from a
JSONValue, which may cause problems if you've already implemented this yourself, but which should mostly just replace the need to implement it yourself. Please file issues ASAP if you run into problems here. (#1317) - Works around an issue causing some attempts to store arrays of JSON dictionaries to have arbitrary key ordering. (#1281)
- Adds clearer error descriptions to a few errors. (#1295)
- Updates the CLI to
2.28.3to fix an issue where linter failures would cause a silent failure exit. (#1284, #1288](apollographql#1288)) - Adds a check to swift scripting that the downloaded file has the correct SHASUM, otherwise forcing redownload. (#1288)
- NEW: Swift scripting is officially out of Beta! Please check out our updated guide to integration. The tutorial should be updated to recommend using Swift Scripting within the next week or so. NOTE: The shell script is not deprecated yet, but will be shortly. (#1263)
- BREAKING: Found some workarounds to conditional conformance and updated all extensions to use the
apollo.extensionMethodsyntax introduced in0.28.0. (#1256) - BREAKING: Moved a few things into the new
ApolloCorelibrary. For CocoaPods and SPM users, this should be automatically picked up by your package manager. Carthage users, you will need to drag the newApolloCorelibrary into your project manually as you have with the other Apollo libs. (apollographql#1256) - BREAKING: Updated to version
2.28.0of the Apollo JS CLI. This includes moving a bunch ofstatic letallocations to computedstatic vars to prevent memory overuse. (#1246) - Made
GraphQLGetTransformerand its methods public and made a couple more methods onMultipartFormDatapublic. (#1273) - Fixes an issue when uploading multiple files for different variables. (#1279, special thanks to #1081)
- Fixes a crash when encoding
GraphQLVariableobjects which conform toJSONEncodable. (#1262)
- BREAKING: Changed a few things in the
ApolloCodegenlibrary to useobject.apollo.extensionMethodsyntax rather thanobject.apollo_extensionMethod. There's a few things that are still usingapollo_notation due to constraints around conditional conformance, but you should particularly check your swift scripts for changes aroundFileManagerAPIs. (#1183) - BREAKING:
NormalizedCachenow has a method for explicitly clearing the cache synchronously, in addition to the existing method to clear it asynchronously. If you've got a customNormalizedCacheimplementation, you'll need to add an implementation for this method. (#1186) - Fixed race conditions in
URLSessionClientthat were causing unexpected behavior. Turns out concurrency is hard! (#1227) - Improved handling of a dependent key update cancelling an in-flight server fetch on a watcher. (#1156)
- Added option to Swift Codegen to pass in a prefix for custom scalars. (#1216)
- Added ability to change a header on a websocket connection and automatically reconnect. (#1224)
- Better defense against multithreading crashes in
URLSessionClient. (#1184) - Fix for watchOS availability for
URLSessionClient. (#1175)
- BREAKING: Replaced calls directly into the closure based implementation of
URLSessionwith a delegate-based implementation calledURLSessionClient.-
This (finally) allows background session configurations to be used with
ApolloClient, since background session configurations immediately error out if you try to use the closure-basedURLSessionAPI. -
This makes a significant change to the initialization of
HTTPNetworkTransportif you're using a customURLSession: BecauseURLSessionmust have its delegate set at the point of creation,URLSessionClientis now creating the URL session. You can initialize aURLSessionClientwith aURLSessionConfiguration. if before you were using:let session = URLSession(configuration: myCustomConfiguration) let url = URL(string: "http://localhost:8080/graphql")! let transport = HTTPNetworkTransport(url: url, session: session)
You will now need to use:
let client = URLSessionClient(sessionConfiguration: myCustomConfiguration) let url = URL(string: "http://localhost:8080/graphql")! let transport = HTTPNetworkTransport(url: url, client: client)
-
If you were passing in a session you'd already set yourself up to be the delegate of to handle GraphQL requests, you'll need to subclass
URLSessionClientand override any delegate methods off ofURLSessionDelegate,URLSessionTaskDelegate, orURLSessionDataDelegateyou need to handle. Unfortunately only one class can be a delegate at a time, and that class must be declared when the session is instantiated.Note that if you don't need your existing delegate-based session to do any handling for things touched by Apollo, you can keep it completely separate if you'd prefer.
-
This does not change anything at the point of calls - everything is still closure-based in the end
Please file bugs on this ASAP if you run into problems. Thank you! (#1163)
-
- BREAKING, though in a good way: Updated the typescript CLI to 2.27.2, and updated the script to pull from a CDN (currently backed by GitHub Releases) rather than old Circle images. This should significantly increase download performance and stability. (#1166)
- BREAKING: Updated the retry delegate to allow more fine-grained control of what error to return if an operation fails in the process of retrying. (#1128, #1167)
- Added support to the Swift scripting package to be able to use multiple headers when downloading a schema. (#1153)
- Added the ability to set the SSL trust validator on a websocket. (#1124)
- Fixed an issue deserializing custom scalars in
ApolloSQLite. (#1144)
- Repoints download link to our CDN for the CLI for people on 0.25.0 who can't upgrade to 0.26.0 or higher immediately.
- BREAKING: Updated the
swift-toolsversion to 5.2 inPackage.swift. Note that if you're usingswift-tools5.2, you'll need to update the syntax of yourPackage.swiftfile and specify the name of the library manually for Apollo. (#1099, #1106) - POSSIBLY BREAKING: Upgraded the typescript CLI to 2.26.0. No changes were found in test frameworks, but this could theoretically break some stuff. (#1107, #1113)
- NEW: Added the ability to set Starscream's underlying
enableSOCKSProxyto better allow debugging web sockets in tools like Charles Proxy. (#1108) - Fixed several issues using paths with spaces in the Swift Codegen. (#1092, #1097).
ApolloCodegenLibis now properly passing theheaderargument last when downloading a schema. (#1096)- Automatic Persisted Queries now also work with mutations. (#1110)
- Repoints download link to our CDN for the CLI for people on 0.24.0 who can't upgrade to 0.26.0 or higher immediately.
- BREAKING: Updated
GraphQLResponseto be generic over the response type rather than the operation type. This will allow more flexibility for generic modifications to methods that need to useGraphQLResponse. (#1061) - BREAKING: Updated the file URL-based initializer of
GraphQLto throw with a clear error instead of failing silently. Removed the ability to pass in an input stream since that can't be recreated on a failure. Updated initializers take either rawDataor a file URL so that the input stream can be recreated on a retry. (#1086, #1089) - In the Swift Package Manager based codegen, made sure that the folder the CLI will be downloaded to is created if it doesn't exist. (#1069)
- Repoints download link to our CDN for the CLI for people on 0.23.x who can't upgrade to 0.26.0 or higher immediately.
- Changed the
@availableflags 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 theApolloCodegenLiblibrary even if it's not included in the target being previewed. (#1066) - Added support for
omitDeprecatedEnumCasescommand line option I missed forApolloCodegenOptions(#1053)
- Added some
@availableflags to prevent accidental compilation ofApolloCodegenLibon platforms other than macOS. (#1041) - Made the
QueryonGraphQLQueryWatcherpublic 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)
- Repoints download link to our CDN for the CLI for people on 0.22.0 who can't upgrade to 0.26.0 or higher immediately.
- 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
HTTPNetworkTransportto be aweak varand to not be passed in as a parameter to the initializer. (#990, #1002) - Added a lock to
InMemoryNormalizedCacheto 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)
- Repoints download link to our CDN for the CLI for people on 0.21.0 who can't upgrade to 0.26.0 or higher immediately.
- BREAKING, but by popular request: Removed the requirement that the
clientNameandclientVersiononNetworkTransport, and added a default implementation so custom implementations don't need to set these up themselves. (#954)
- Repoints download link to our CDN for the CLI for people on 0.20.0 who can't upgrade to 0.26.0 or higher immediately.
- Fixed a bunch of data races in
ApolloWebSocket. (#880) - Updated
ApolloWebSocketto depend onApolloinPackage.swiftsince there is a dependency there. (#906) - POSSIBLY BREAKING Updated Swift tools version in package declaration to 5.1. (#883)
- Repoints download link to our CDN for the CLI for people on 0.19.0 who can't upgrade to 0.26.0 or higher immediately.
- 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
NetworkTransportif you need something more granular for different versions of your application. (#858) - POSSIBLY BREAKING: The
NetworkTransportprotocol is now class-bound. If you built your ownNetworkTransportimplementation instead of one of the ones included with the library, this now must be aclassinstead of astruct. (#770) - POSSIBLY BREAKING: Removed an
unzipmethod 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)
- Repoints download link to our CDN for the CLI for people on 0.18.x who can't upgrade to 0.26.0 or higher immediately.
- 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
--omitDeprecatedEnumCasesflag - Fix for generating input fields for
nullvalues
- 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
ApolloClientobject, 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-codegenscript. (#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
--suppressSwiftMultilineStringLiteralsflag which produces single-line queries stripped of whitespace. (#831) - Fixed a couple places we were not using
LocalizedErrorproperly. (#818)
- Updated the way
run-bundled-codegenchecks 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
Promiseimplementation, which was never intended to be public. (#709) - Fixed a deadlock in a transaction. (#763, #365)
- Added a
RequestCreatorProtocolto 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.2due 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
.nonecase (Tooling #1482)
If you run into any weird build issues after this update, try deleting your local
node_modulesfolder and rebuilding before filing an issue. (#760) -
Better handling of the
localizedDescriptionforHTTPResponseError. (#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
GraphQLQueryWatcherso it can actually be instantiated. (#750)
-
BREAKING: Finally swapped out
URLSessionConfigurationon initializer forHTTPNetworkTransportto useURLSessiondirectly instead. If you were previously passing in a configuration, first hand it to aURLSessioninstance 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
ApolloSQLiteandApolloWebSocket. (#674) - Created
ApolloClientProtocolto match all public methods ofApolloClientfor 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
.nonewhen the thing being unwrapped was a double-optional, which was causing some crashes - Fixes issue where removing redundant modifiers was a little too aggressive
- Fixes escaping for
Selfas a type name - Adds
CaseIterablefor 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
Intcustom scalars. (#402) -
Exposed
clearCachedirectly 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
Resultinstead 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
nilin previous iterations, you will now get anError. This will generally be aJSONDecodingError.missingValue, either as the direct error or as theunderlyingerror of aGraphQLResultError. Please check out the changes toFetchQueryTestsin 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=swiftso 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=./*.graphqlinstead.
If you get error messages about multiple versions of node when you attempt to run, delete the
node_modulesfolder in your source root and rebuild.Upgrading fixes several issues:
operationNameis 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
operationNameis generated for all operations, we're sending it along with all requests. (#657, inspired by #492) -
NEW: We're also sending
operationNameas theX-APOLLO-OPERATION-NAMEheader and when anoperationIdentifieris provided, sending that as theX-APOLLO-OPERATION-IDheader. (#658) -
NEW: Option to run
VACUUMon 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
GraphQLResultErrorand its underlying errorpublicfor better error handling. (#655)
- BREAKING: Removed internal
Resulttype in favor of Swift's built inResulttype. This allows you to not have to prefix anything that uses the built-in result type withSwift.Resultin 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
ApolloSQLiteorApolloWebSocketframeworks with Carthage, please read the updated documentation!. (#635, #641) - Fixed issue where
GETrequests were requiringAnyHashableinstead ofAnywhich made requests withBoolproperties never send. (#628, big thanks to #624)
- Fixed missing
Foundationimports for several classes that were causing issues with Buck and Swift Package Manager builds. (#620) - Updated version of
SQLite.swiftdependency 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
GraphQLResultinitializer 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
URLSessionand the ability to determine if an operation should be retried. (#602) - NEW: Added
.fetchIgnoringCacheCompletelycaching option, which can result in significantly faster performance if you don't need the caching. (#551) - NEW: Added support for using
GETfor 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
readandupdateoperations 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
readandupdateoperations (#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-clito1.9. A nice addition to1.9.2is that Swift Enums now conforms to Hashable enabling among other things comparison 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
wrongTypecase being returned by theJSONDecodingErrorimplementation ofMatchable. (#367) - Added delegate for WebTransport which can handle connection/reconnection/disconnection events of websocket. (#379)
- Since
apollo-codegenis now part of the newapollo-cli, the build script used to generateAPI.swiftneeds 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
fragmentswhen 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
nulland a property not being present.