Skip to content
CAI
Software that uses CAICheck a score

apollographql/apollo-ios

57.6

Weak · 30 September 2026

13.7k

lines of production code

Swift

primary language

2

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

This system is the Apollo iOS library, a GraphQL client for Apple platforms that manages network requests, caching, and real-time subscriptions. It provides a modular architecture with interceptor-based request chains, normalized caching via in-memory or SQLite storage, and WebSocket transport for subscriptions. The library supports modern GraphQL features like incremental responses and client awareness, while offering test utilities and CLI tools for code generation.

How it got here

2016 — Apollo iOS cleanup and SPM migration

9 changes.

The Apollo framework implementation and legacy Xcode project structures were removed from the repository, alongside user-specific configuration files and outdated example projects. The package was reorganized using Swift Package Manager with updated platform requirements and distinct library targets, supported by new scripts for CLI management.

2017–2022 — Apollo iOS 2.4.0 release and infrastructure refactoring

7 changes.

This period focused on the Apollo iOS 2.4.0 release, introducing client awareness, incremental response support, and enhanced error handling. Significant backend work included refactoring the SQLite cache for performance and rewriting the WebSocket transport for thread safety and protocol compliance. The effort also established core API types, improved schema type definitions, and updated test and CLI infrastructure to support modern Swift and Xcode environments.

2024–2025 — normalized caching and request chain refactoring

5 changes.

This period focused on implementing a robust normalized caching system with thread-safe storage and introducing a modular, interceptor-based request chain for network operations. The work also enhanced response parsing to support multipart streams and deferred queries while ensuring compliance with Apple's privacy requirements.

Features

Apollo iOS 2.4.0 release with client awareness and incremental response support

This release introduces client awareness metadata, allowing applications to send their name, version, and library details to the server for GraphOS Studio insights. It also adds support for incremental responses (GraphQL @defer) via new \IncrementalDeferredResponseFormat\ types and \DataDict\ merging logic. The \GraphQLError\ struct now exposes a \path\ field to identify the specific field that triggered an error, and the \ApolloClient\ provides a new \clearCache()\ method to programmatically clear the local normalized cache.

Sources/Apollo · high confidence

ApolloAPI module introduces core types for GraphQL execution, caching, and nullability

The ApolloAPI module now provides the foundational types required for GraphQL operations, including DataDict for wrapping selection set data, GraphQLNullable to distinguish between nil and null input values, and CacheKeyInfo for configuring normalized cache key resolution. It also introduces FieldPolicy and InputData to support programmatic field policy configuration, GraphQLEnum for handling enum responses with unknown cases, and Deferred to manage @defer directive support. Additionally, the module defines JSON encoding/decoding protocols (JSONEncodable, JSONDecodable) and helper types like AnySendableHashable to ensure safe equality and hashing for Sendable & Hashable values.

Sources/ApolloAPI · high confidence

Introduction of normalized caching infrastructure and thread-safe store

This change introduces the core components for Apollo's normalized caching system, including the \ApolloStore\ for managing cache access, \NormalizedCache\ and \InMemoryNormalizedCache\ for data storage, and \CachePolicy\ enums to control fetch behavior (e.g., \cacheFirst\, \networkFirst\). To ensure thread safety, the \ApolloStore\ utilizes a new \AsyncReadWriteLock\ implementation that manages concurrent read and write access to the underlying cache, addressing data race issues. The update also adds supporting utilities such as \Record\ and \RecordSet\ for cache entries, \CacheReference\ for object identification, and internal helpers for data loading and atomic operations.

Sources/Apollo/Internal Utilities · high confidence

New scripts for CLI version verification and download

Added shell scripts to automate the download and version-checking of the Apollo iOS CLI tool. The new \download-cli.sh\ script fetches the CLI binary from GitHub releases based on the current project version, while \cli-version-check.sh\ verifies that the downloaded CLI version matches the core library version to ensure compatibility. These scripts support the InstallCLI plugin workflow by providing a reliable way to manage and validate the CLI dependency.

scripts · high confidence

Removals

Apollo framework files removed from repository

The core Apollo library source files, including the main header, client, GraphQL types, JSON handling, and network transport implementations, have been deleted from the Apollo directory. This change removes the entire Apollo framework implementation from this location, indicating the library is no longer maintained or distributed as part of this codebase.

Apollo · high confidence

Removal of legacy Apollo iOS Xcode project

The legacy \Apollo.xcodeproj\ file has been deleted from the repository. This removes the old Xcode project structure that previously managed the Apollo framework, its test targets, and bundled example queries (such as the Star Wars API examples). Users relying on this specific project file for building or integrating the library will need to migrate to the current project structure or package manager configuration.

Apollo.xcodeproj · high confidence

Removed GitHunt playground example

The GitHunt playground, which demonstrated Apollo GraphQL queries against a local server, has been removed. This change deletes the main execution file, the generated query models for Entry and Feed, and the associated playground metadata, effectively eliminating this specific example from the project.

GitHunt.playground · high confidence

Removed handwritten GraphQL query and fragment definitions from ApolloTests

The ApolloTests target no longer includes manually written Swift files for GraphQL queries and fragments (such as HeroNameQuery, FragmentTypingQuery, and various fragment definitions). These handwritten API code files have been removed, indicating a shift toward using generated API code for test data structures.

ApolloTests · high confidence

Behavioural changes

Added privacy manifests to Apollo targets

Added PrivacyInfo.xcprivacy files to the Apollo, ApolloAPI, ApolloSQLite, and ApolloWebSocket targets. These manifests declare that no user data is collected, no APIs are accessed, no tracking domains are used, and tracking is disabled, ensuring compliance with Apple's App Privacy requirements.

(repo-wide) · high confidence

InstallCLI plugin now supports Xcode 16.3+ path resolution

The InstallCLI plugin has been updated to correctly locate the CLI download script in newer Xcode versions. Specifically, the plugin now detects Xcode 16.3 and later, adjusting the relative path to the \download-cli.sh\ script from \../../../\ to \../../../../\ within the plugin work directory. This ensures the CLI installation process works reliably across different Xcode toolchain structures, preventing failures caused by incorrect script paths in recent Xcode releases.

Plugins/InstallCLI · high confidence

New cache read execution source and field selection logic

The \Sources/Apollo/Execution\ area introduces \CacheDataExecutionSource\ and \FieldSelectionCollector\ to handle reading from the normalized cache. \CacheDataExecutionSource\ resolves fields from \Record\ objects, supporting programmatic field policies and nested \CacheReference\ lists via \resolveReferences\. \FieldSelectionCollector\ groups fields and manages fragment states (fulfilled vs. deferred) for the execution pipeline. This change modifies how cached data is traversed and resolved during reads.

Sources/Apollo/Execution · high confidence

New interceptor-based request chain architecture

The Apollo iOS networking layer has been refactored to use a modular, interceptor-based request chain. This change introduces a new \RequestChain\ that processes requests through a configurable pipeline of \GraphQLInterceptor\s, \HTTPInterceptor\s, and a \CacheInterceptor\. Key additions include the \DefaultInterceptorProvider\ which wires together default behaviors like \MaxRetryInterceptor\ (with configurable exponential backoff and jitter), \AutomaticPersistedQueryInterceptor\, and \ResponseCodeInterceptor\. The \GraphQLRequest\ protocol now maps its \FetchBehavior\ directly to \URLRequest\ cache policies to prevent URL cache interference, and the \RequestChainNetworkTransport\ has been updated to construct and execute requests through this new chain, supporting subscriptions with state tracking.

Sources/Apollo/RequestChain · high confidence

New schema type definitions and protocol conformances in ApolloAPI

The SchemaTypes module now includes new protocol and struct definitions for GraphQL schema elements: EnumType, InputObject, Interface, Object, and Union. EnumType now conforms to Sendable and other standard protocols. InputObject introduces a new InputDict wrapper with subscript accessors for handling input data, and adds support for OneOfInputObject. Interface and Object structs now support keyFields for caching policies via @typePolicy directives, and Object includes a deprecated implementedInterfaces property in favor of an implements(\_:) method. Union provides a list of possible types. These changes enhance type safety, caching capabilities, and alignment with GraphQL spec requirements.

Sources/ApolloAPI/SchemaTypes · high confidence

New test mock infrastructure for Apollo iOS

The ApolloTestSupport module has been rewritten to provide a new, type-safe way to create mock data for testing GraphQL operations. This change introduces a \Mock\ class that uses property wrappers and dynamic member lookup to allow developers to populate mock objects with scalar, entity, and list values in a strongly-typed manner. It also includes a \from\ method on \RootSelectionSet\ that converts these populated mocks into valid \SelectionSet\ instances, enabling tests to verify how the application handles specific data structures without needing a live network response.

Sources/ApolloTestSupport · high confidence

Removed legacy Xcode workspace configuration

The legacy \contents.xcworkspacedata\ file, which previously referenced the \Apollo.xcodeproj\, has been removed from the project structure. This change eliminates the old workspace configuration, aligning with the migration of folder references and the removal of Xcode user state files.

Apollo.xcodeproj/project.xcworkspace · medium confidence

Removed user-specific Xcode scheme files

The user-specific Xcode scheme configuration files (Apollo.xcscheme and xcschememanagement.plist) located in the xcuserdata directory have been removed from the repository. This change eliminates local developer settings from version control, ensuring that the project no longer tracks individual machine-specific build configurations.

Apollo.xcodeproj/xcuserdata/martijnwalraven.xcuserdatad/xcschemes · high confidence

SQLite cache implementation refactored for extensibility and performance

The ApolloSQLite module has been restructured to replace the external SQLite.swift dependency with a direct sqlite3 implementation, exposing a new \SQLiteDatabase\ protocol that allows for custom database implementations. This change introduces batched writing and reading of records to improve performance, adds a \JournalMode\ enum to configure SQLite journaling settings, and includes a \close()\ method (exposed via Testing SPI) to safely manage database connections during test teardowns.

Sources/ApolloSQLite · high confidence

Support for multipart responses and improved deferred path resolution

The response parsing layer now supports streaming multipart responses (including \@defer\ and subscriptions) by introducing \AsyncHTTPResponseChunkSequence\ to split HTTP streams into chunks and dedicated parsers for \deferSpec=20220824\ and \subscriptionSpec=1.0\. For deferred operations, the system now resolves incremental paths against existing cache records to ensure data is written to the correct cache keys; if a path cannot be resolved or is ambiguous, it throws a specific error instead of silently writing to a phantom record. Additionally, multipart parsing now correctly handles the close delimiter to prevent infinite loops on invalid responses.

Sources/Apollo/ResponseParsing · high confidence

WebSocket transport refactored for improved reliability and protocol compliance

The ApolloWebSocket module has been completely refactored to use Swift actors for thread safety, eliminating data races and potential crashes during connection lifecycle events. The transport now strictly adheres to the \graphql-transport-ws\ protocol, supporting configurable connection initialization payloads, custom operation message ID generation, and client-initiated ping/pong keepalives. Subscription management is more robust, with automatic reconnection and resubscription of active subscriptions upon network recovery, while one-shot queries and mutations are correctly terminated during disconnects. New lifecycle delegate methods allow applications to monitor connection states (connect, reconnect, disconnect) and handle ping/pong events, and the underlying \URLSessionWebSocketTask\ is now abstracted to facilitate testing.

Sources/ApolloWebSocket · high confidence

Dependencies

Swift Package Manager manifest updated to Swift 6.1 with new platform and target structure

The Package.swift file has been rewritten to target Swift 6.1, raising the minimum supported platforms to iOS 15, macOS 12, tvOS 15, watchOS 8, and visionOS 1. The package structure has been reorganized to expose distinct libraries for Apollo, ApolloAPI, ApolloSQLite, ApolloWebSocket, and ApolloTestSupport, alongside an InstallCLI plugin. All targets now include privacy manifests and are configured to use Swift 6 language mode, while the package itself supports both Swift 5 and 6 language modes for broader compatibility.

(dependencies) · high confidence

Housekeeping

Removed personal Xcode debugger state

The file containing personal Xcode debugger breakpoint configurations has been removed from the repository. This change cleans up user-specific state that was previously committed, ensuring that individual developer settings do not interfere with the shared project configuration.

Apollo.xcodeproj/xcuserdata/martijnwalraven.xcuserdatad/xcdebugger · high confidence

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 62 → 58 (-4.0)
  • Rubric changed (rubric-2026.09.11 → rubric-2026.09.18) — scores are not directly comparable.

Lenses

  • Code Health 98 → 98 (-0.6)
  • Architecture 96 → 92 (-4.5)
  • Maturity 57 → 57 (+0.0)
  • Readiness 53 → 50 (-2.7)
  • Security 62 → 62 (+0.0)
  • Performance 64 (new)

Resolved (3)

  • Documentation: no installation or build instructions (README.md)
  • Off-boarding risk: anonymized user #1
  • Off-boarding risk: anonymized user #2

New (12)

  • Conflicting cache policy types for refetch. The refetch method has overloads for SingleResponse and CachePolicy_v1. CachePolicy_v1 appears to be a legacy or deprecated type, while SingleResponse is a newer specific type. This creates ambiguity for users about which policy type to use.
  • Duplicate intent via different parameter types. The API exposes specific cache policy types (SingleResponse, CacheAndNetwork, CacheOnly) as distinct overloads, but also exposes a generic FetchBehavior enum that contains these same behaviors. This forces users to choose between using specific types or the enum, which is confusing and redundant.
  • Duplicated block (6 lines × 3) (Sources/ApolloWebSocket/WebSocketMessage.swift)
  • Duplicated block (8 lines × 2) (Sources/ApolloAPI/AnySendableHashable.swift)
  • Incoming.from (cognitive 16) (Sources/ApolloWebSocket/WebSocketMessage.swift)
  • Incoming.from (cyclomatic 17) (Sources/ApolloWebSocket/WebSocketMessage.swift)
  • Low cohesion: Array (LCOM4 6) (Sources/Apollo/DataDict+Merging.swift)
  • Off-boarding risk: anonymized user #1
  • Projects may be oversized for their cohesion
  • Redundant and inconsistent cache clearing APIs. ApolloClient exposes two overloads for clearCache (sync and async), while ApolloStore also exposes two overloads. This creates confusion about whether to call the client or the store directly, and duplicates the sync/async pattern across two types that are tightly coupled. The client's clearCache is likely a thin wrapper around the store's, making the store's public API redundant in the context of the client.
  • Redundant overloads in GraphQLQueryWatcher. Similar to ApolloClient, the watcher exposes both specific cache policy types and the generic FetchBehavior enum for its fetch method.
  • Same duplication issue as fetch but for watch. The watch method has overloads for specific cache policies and a generic FetchBehavior, creating the same redundancy and confusion.

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

apollographql/apollo-ios was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 30 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 431a15e382f17ade306c0dbb85fd4a63e37610d9 — the exact code this score is about.
  • Scored under rubric-2026.09.18 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-cb25ca4feafa.