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.