Releases: apollographql/apollo-ios
Releases · apollographql/apollo-ios
2.1.2
Fixed
- Make
SubscriptionStreaminitializer public (#975): TheSubscriptionStreaminitializer was inadvertently scoped topackageaccess, preventing adopters from writing custom conformances to the publicSubscriptionNetworkTransportprotocol. The initializer is nowpublic. Fixes #3637. Thank you to @ahou8 for raising the issue. - Fix
\r\nin GraphQL descriptions generating invalid Swift comments (#961): GraphQL field descriptions containing\r\n(Windows CRLF) line endings caused codegen to emit invalid Swift — only the first line received the///doc comment prefix and subsequent lines were emitted as uncommented text, breaking compilation. Fixes #3553. Thank you to @iPhoneNoobDeveloper for the contribution.
1.25.6
Fixed
- Fix
\r\nin GraphQL descriptions generating invalid Swift comments (#965): GraphQL field descriptions containing\r\n(Windows CRLF) line endings caused codegen to emit invalid Swift — only the first line received the///doc comment prefix and subsequent lines were emitted as uncommented text, breaking compilation. Backport of #961. Fixes #3553. Thank you to @iPhoneNoobDeveloper for the contribution.
2.1.1
Fixed
- Fix cache read failure for nested arrays of objects (#938): Reading nested arrays of objects (2D, 3D, etc.) from the normalized cache threw a
JSONDecodingError.wrongTypeerror. Reference resolution now handles array nesting at any depth. Fixes #3609. Thank you to @gurusekhar-ibm for raising the issue. - Fix incorrect default mock value when first enum case is deprecated (#949): When
deprecatedEnumCaseswas set to.exclude, the mock codegen incorrectly used the first enum case as the default value in convenience initializers — even if that case was deprecated and excluded from the generated enum, causing a compile error. Fixes #3634. Thank you to @cswelin for raising the issue. - Fix recursive
OneOfinput object enum cases not markedindirect(#954): A@oneOfinput object that directly references itself generated a Swift enum that failed to compile withRecursive enum is not marked 'indirect'. Self-referencing cases are now correctly markedindirect. Fixes #3633. Thank you to @ahou8 for raising the issue.
1.25.5
Fixed
- Fixed concurrency crash in
compileGraphQLResulton Swift 6.3/macOS 26 (#929): Serializedasync letcalls incompileGraphQLResultto work around a Swift concurrency runtime crash triggered when code generation is used in anAsyncParsableCommand. See PR #942. Thank you to @m4p for the contribution.
2.1.0
New
- WebSocket Transport: Apollo iOS 2.0 now supports WebSocket connections using the
graphql-transport-wsprotocol for subscriptions, queries, and mutations. See the WebSocket Transport documentation for setup and usage details. - Swift 6.2 MainActor default isolation support (#925): Added a
markTypesNonisolatedcodegen option that emitsnonisolatedon all generated type declarations. This prevents compilation errors whenSWIFT_DEFAULT_ACTOR_ISOLATION = MainActoris enabled. The option defaults totruewhen the codegen tool is compiled with Swift 6.2+. - ApolloURLSession delegate injection (#899): Added support for injecting a custom
URLSessionTaskDelegateintoApolloURLSession, enabling delegate callback handling. Thank you to @hammy-e for the contribution.
Fixed
- Fix concurrency issue in
compileGraphQLResult(#929): Resolved a Swift compiler crash triggered byasync letstack management during code generation inAsyncParsableCommandcontexts. Thank you to @m4p for the contribution.
New
- WebSocket Transport: Apollo iOS 2.0 now supports WebSocket connections using the
graphql-transport-wsprotocol for subscriptions, queries, and mutations. See the WebSocket Transport documentation for setup and usage details. - ApolloURLSession delegate injection (#899): Added support for injecting a custom
URLSessionTaskDelegateintoApolloURLSession, enabling delegate callback handling. Thank you to @hammy-e for the contribution. - Make
JSONRequest.useGetForQueriesmutable (#897): TheuseGetForQueriesproperty onJSONRequestis now avar, allowing interceptors to mutate the request directly instead of copying it. Thank you to @nevil for the contribution.
Fixed
- Add preflight HTTP header for CSRF prevention (#900): Added the
X-Apollo-Operation-Nameheader to requests to satisfy Apollo Router's CSRF prevention requirements.
Improved
- Use dictionary for
objectType(forTypename:)lookup (#918): Replaced the generatedswitchstatement inSchemaMetadata.objectType(forTypename:)with a static dictionary lookup, improving deserialization performance by ~75% for schemas with many types (4000+). Thank you to @erneestoc for the contribution.
1.25.4
Improvement
- Use dictionary instead of switch for
objectType(forTypename:)lookup (#3631): The generatedSchemaMetadata.objectType(forTypename:)method now uses a static dictionary for O(1) hash-based lookup instead of a switch statement that performed O(n) linear scanning. For schemas with many object types (~4300 types), this improves deserialization times by approximately 75%. See PR #926.
2.1.0-rc-1
New
- WebSocket Transport: Apollo iOS 2.0 now supports WebSocket connections using the
graphql-transport-wsprotocol for subscriptions, queries, and mutations. See the WebSocket Transport documentation for setup and usage details. - ApolloURLSession delegate injection (#899): Added support for injecting a custom
URLSessionTaskDelegateintoApolloURLSession, enabling delegate callback handling. Thank you to @hammy-e for the contribution. - Make
JSONRequest.useGetForQueriesmutable (#897): TheuseGetForQueriesproperty onJSONRequestis now avar, allowing interceptors to mutate the request directly instead of copying it. Thank you to @nevil for the contribution.
Fixed
- Add preflight HTTP header for CSRF prevention (#900): Added the
X-Apollo-Operation-Nameheader to requests to satisfy Apollo Router's CSRF prevention requirements.
Improved
- Use dictionary for
objectType(forTypename:)lookup (#918): Replaced the generatedswitchstatement inSchemaMetadata.objectType(forTypename:)with a static dictionary lookup, improving deserialization performance by ~75% for schemas with many types (4000+). Thank you to @erneestoc for the contribution.
2.0.6
Fixed
- Fix HTTP method selection (#877): The APQ retry logic was overriding the HTTP method selected for all queries. Thank you to @3redrubies for raising the issue.
- Prevent crashes in
Dictionaryinitialization with duplicate keys (#884):Dictionaryinitialization using literal elements now uses a safer internal initializer to prevent crashes when duplicate keys are used. In the event that duplicate keys are present, the value associated with the first key will override all other values. Thank you to @adysart for raising the issue.
2.0.5
- Fix data race in
AsyncReadWriteLock(#862): This fixes issue #3616. Thank you to @AlexPan1992 for raising the issue. - Set
URLRequest.cachePolicyonGETrequests (#859): Thank you to @samjdurante for the contribution.
2.0.4
Fixed
- Fix infinite loop bug in Test Mocks (#842): Thank you to @AlexPan1992 for raising the issue.
- Improve error description formatting for validation failure (#846): GraphQL validation errors encountered while running code generation are now formatted to be easier to read in logs. Thank you to @dfed for the contribution.
- Fix deadlock in
AsyncReadWriteLock(#851): When under heavy loads, theAsyncReadWriteLockused by theApolloStorecould cause a deadlock. This is now resolved. Thank you to @marksvend for raising the issue. - Fix cancellation error for single response operations (#855): When a single response operation was cancelled, a
.noResultserror was thrown instead of the expectedCancellationError. This is now resolved. Thank you to @3redrubies for raising the issue. - Fix multipart parsing error (#852): When a multipart message was received with characters after the closing boundary the multipart parser would emit a
cannotParseChunkDataparsing error. This is now resolved. Thank you to @ecant for raising the issue.