github apollographql/apollo-ios 2.3.0

latest release: 1.25.7
7 hours ago

New

  • Add opt-in additionalCapitalizationRules to codegen (#1037): Adds a new opt-in additionalCapitalizationRules codegen option and public CapitalizationRule API (a Term of .string/.regex and a CaseStrategy of .upper/.lower) so acronyms can be fully capitalized (e.g. userIduserID). Following SwiftFormat semantics, an acronym is only capitalized when its first character is already uppercase, so identifiers like apiKey are preserved. The rules apply to field accessors, initializer parameters, enum cases, input fields, and test mocks. The option defaults to empty, so existing generated output is unchanged. Closes #3419. Thank you to @3redrubies for the contribution.

Fixed

  • Resolve deferred response paths against the initial cache records (#1052): When a @defer query streamed incremental chunks, the deferred path was turned into a cache key by naively joining the root key with the raw path components (e.g. QUERY_ROOT.animal.friend) instead of following the real normalized-record chain (QUERY_ROOT → Animal:<id> → …). The deferred fields landed on phantom records that nothing referenced, so a cache-first read came back missing those fields. Deferred paths are now resolved by walking the initial response's already-normalized records at parse time, so deferred fields merge onto the correct records. Fixes #3380. Thank you to @joseph-francis-ih for the contribution.
  • Close the old connection in WebSocketTransport.disconnectAndReconnect() (#1055): disconnectAndReconnect() replaced the active connection without closing the old one first. Because the old WebSocketConnection was strongly held by its receive loop's parked Task, it never deallocated — leaking the connection and its underlying URLSessionWebSocketTask, and delivering duplicate next messages routed through the stale connection. The old connection is now closed before being replaced. Fixes #3649.
  • Remove unnecessary throws from WebSocketTransport.init (#1039): WebSocketTransport.init was marked throws but made no throwing calls; the vestigial annotation has been removed. This is a source-breaking change for callers who used try when constructing a WebSocketTransport. Closes #3638.

Improved

  • Prune the findInXcode directory walk (#1015): VersionChecker.findInXcode recursively enumerated every descendant of the project root to locate Package.resolved, walking build artifacts, .git, vendored dependencies, and git worktrees on every generate/fetch-schema invocation. The walk now skips hidden files and package descendants, reducing a ~30s walk to ~0.2s on a repo with ~150k nested files. Note: a project located inside a hidden directory is no longer discovered; this is intentional. Thank you to @dfed for the contribution.

Don't miss a new apollo-ios release

NewReleases is sending notifications on new releases.