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.