Skip to content
CAI
Software that uses CAICheck a score

apollographql/apollo-ios

50.7

Adequate · 14 November 2026

11.4k

lines of production code

Swift

with TypeScript

5

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

This system is the Apollo iOS client library, a framework for interacting with GraphQL APIs in Swift applications. It provides core networking capabilities via HTTP and WebSocket transports, including support for file uploads and automatic persisted queries. The system features a modular architecture with pluggable caching mechanisms, such as an in-memory store and a persistent SQLite-backed normalized cache. Additionally, it includes a comprehensive code generation infrastructure that converts GraphQL schemas and operations into type-safe Swift code.

How it got here

2016 — Infrastructure modernization and tooling

10 changes.

This period focused on modernizing the project's build infrastructure by introducing Swift Package Manager and CocoaPods support while cleaning up legacy Xcode configurations and user-specific artifacts. Development workflows were streamlined through the addition of automation scripts for code generation and versioning, alongside the removal of outdated manual test files and example playgrounds. Concurrently, test coverage was expanded to validate core client behaviors, caching mechanisms, and network request handling.

2017–2020 — Architecture modernization and codegen overhaul

22 changes.

The project underwent a significant architectural restructuring, introducing a chainable interceptor model for the client, a SQLite-backed normalized cache, and a decoupled WebSocket transport. Concurrently, the code generation infrastructure was completely rewritten in Swift with a new JavaScript-based frontend, replacing external CLI dependencies and enabling robust, self-contained schema management and code generation workflows.

2021 — Apollo API and test infrastructure

7 changes.

This period focused on establishing the foundational ApolloAPI module for CodegenV1 runtime types and introducing the ApolloUtils framework for core utilities. Concurrently, extensive integration and unit test suites were added to verify caching, WebSocket protocols, and code generation workflows, supported by new CI test plans and test support frameworks.

Features

Add SimpleUploadServer for GraphQL file uploads

A new standalone upload server has been added to the project, providing a GraphQL API for handling file uploads. This server exposes mutations for single file uploads, multiple file uploads, and mixed parameter uploads, storing files in a local 'uploads' directory and tracking metadata in a JSON database. It runs on port 4001 and enforces a 10 MB maximum file size with a limit of 20 files per request.

SimpleUploadServer · high confidence

Added GraphQL queries and schema for GitHub API performance testing

New GraphQL query definitions (IssuesAndCommentsForRepository, Repository, RepoURL) and the corresponding GitHub GraphQL schema file have been added to the Sources/GitHubAPI/graphql directory, along with an operationIDs.json manifest. These files provide the specific API contracts and schema metadata required to support the new performance tests for the GitHub API integration.

Sources/GitHubAPI/graphql · high confidence

Added Star Wars API GraphQL schema and operation definitions

The \Sources/StarWarsAPI/graphql\ directory now contains the complete GraphQL schema (\schema.graphqls\, \schema.json\) and a comprehensive set of GraphQL operation files (queries, mutations, and subscriptions) along with their generated metadata (\API.json\, \operationIDs.json\). This includes operations for fetching hero details, searching characters, creating reviews, and subscribing to review updates, providing the necessary source files for code generation against the Star Wars API.

Sources/StarWarsAPI/graphql · high confidence

Added UploadAPI target with multi-file upload mutations

The new UploadAPI module provides generated Swift types for GraphQL file-upload operations, enabling clients to upload files via the \singleUpload\ mutation (one file) and two new multi-file mutations: \multipleUpload\ (uploading multiple files to a single parameter) and \multipleParameterUpload\ (uploading a mix of single and multiple files to different parameters). This includes the underlying GraphQL schema definitions, operation identifiers, and the generated \UploadMultipleFilesToTheSameParameterMutation\ and \UploadMultipleFilesToDifferentParametersMutation\ classes for type-safe API interaction.

Sources/UploadAPI · high confidence

Introduce ApolloAPI module with CodegenV1 runtime types

The new ApolloAPI module provides the runtime foundation for the CodegenV1 code generation strategy, making core GraphQL types available for shipping code. This includes protocols for handling fragments and selection sets, a GraphQLEnum wrapper that safely handles unrecognized enum values, a GraphQLOptional type to distinguish between missing, null, and present values, and schema-related protocols for object types and unions. The module also introduces InputValue for representing GraphQL arguments and a ResponseDict structure to wrap underlying data dictionaries for selection set initialization.

Sources/ApolloAPI · high confidence

Introduce SQLite-backed normalized cache with pluggable database implementation

This change introduces a new \ApolloSQLite\ module that provides a \NormalizedCache\ implementation backed by a local SQLite database. It allows users to persist GraphQL cache data to disk, improving performance for repeated queries and enabling offline capabilities. The implementation features a pluggable database layer (\SQLiteDatabase\ protocol) with a default \SQLiteDotSwiftDatabase\ implementation, supports synchronous cache operations, and includes options to vacuum the database upon clearing to ensure complete data removal for privacy compliance.

Sources/ApolloSQLite · high confidence

Introduce SwiftScripts package for code generation, documentation, and schema management

A new Swift Package named SwiftScripts has been added to provide local tools for code generation, documentation, and schema downloading, removing the dependency on the external Apollo CLI for fetching schemas. The package includes a Codegen tool that generates Swift code for targets like StarWars, GitHub, and Upload using ApolloCodegenLib and ArgumentParser, a DocumentationGenerator that produces API docs for Apollo libraries using SourceDocsLib, and a SchemaDownload utility for introspection-based schema retrieval. This change consolidates these development workflows into a single, locally managed Swift package.

SwiftScripts · high confidence

Introduces ApolloUtils framework with core utility extensions

Adds the new ApolloUtils framework, providing foundational utilities for the Apollo integration. This includes an \ApolloExtension\ mechanism to allow fluent \.apollo\ method calls on base types, thread-safe \Atomic\ value wrappers for concurrent access, and convenience collection extensions (\isNotEmpty\, \isEmptyOrNil\) to simplify handling of optional collections. It also adds a \sha256Hash\ property to strings for cryptographic hashing and exposes versioning constants for the ApolloCore module.

Sources/ApolloUtils · high confidence

New ApolloTestSupport framework for simplified GraphQL testing

The ApolloTestSupport framework has been introduced to provide a comprehensive suite of utilities for testing Apollo GraphQL clients. It includes a MockGraphQLServer and MockNetworkTransport that allow tests to define expected requests and return specific responses without hitting a real network. For result handling, the new AsyncResultObserver simplifies testing asynchronous completion handlers by managing expectations and automatically recording failures. The framework also provides cache testing helpers (InMemoryTestCacheProvider and SQLiteTestCacheProvider), custom assertion helpers like XCTAssertTrueEventually for async conditions, and utilities for mocking URLSession and WebSocket connections.

Sources/ApolloTestSupport · high confidence

New GitHub API framework target with generated GraphQL code

A new framework target named GitHubAPI has been added to the Sources directory, containing auto-generated Swift code for interacting with the GitHub GraphQL API. The primary generated component is the IssuesAndCommentsForRepositoryQuery, which allows users to fetch repository details, including issue titles, bodies, authors, and associated comments. This change also includes the necessary framework metadata files (Info.plist and header) to support the new module.

Sources/GitHubAPI · high confidence

New JavaScript-based GraphQL codegen frontend

The codegen library now includes a new frontend implementation that executes GraphQL parsing, validation, and compilation logic via JavaScriptCore. This change introduces Swift wrapper types for GraphQL schema elements (such as types, fields, and enums), documents, and errors, bridging them to the underlying JavaScript runtime. Users benefit from a unified, JS-driven pipeline for schema loading (supporting both SDL and introspection JSON) and document processing, replacing previous mechanisms with this new JavaScript-based approach.

Sources/ApolloCodegenLib/Frontend · high confidence

New Swift-based codegen and schema download infrastructure

Introduces a new Swift library (ApolloCodegenLib) that replaces the previous script-based approach with native Swift code for downloading the Apollo CLI, validating its integrity via SHASUM, and executing code generation. Users can now configure code generation via \ApolloCodegenOptions\ (supporting TypeScript/JS CLI targets, output formats, access modifiers, and custom scalars) and download schemas via \ApolloSchemaDownloader\ (supporting Apollo Registry and GraphQL Introspection with configurable HTTP methods and headers). The library handles CLI extraction, folder creation, and logging internally, providing a more robust and configurable experience for Swift developers on macOS.

Sources/ApolloCodegenLib · high confidence

New utility scripts for codegen, versioning, and build configuration

This change introduces a suite of new shell scripts to the \scripts\ directory to streamline development and release workflows. The \run-bundled-codegen.sh\ script automates the download, validation (via SHASUM), and execution of the Apollo CLI (v2.33.9), ensuring a consistent and secure code generation environment. New version management scripts (\set-version.sh\, \get-version.sh\, \version-constants.sh\) standardize how project versions are bumped and committed. Additionally, \ensure-no-build-settings-in-pbxproj.sh\ enforces best practices by preventing build settings from being hardcoded in Xcode project files, and \carthage-build-workaround.sh\ provides a fix for Xcode 12 architecture issues during Carthage builds.

scripts · high confidence

Removals

Removal of Apollo client library source files

The Apollo client library source files, including ApolloClient.swift, GraphQL.swift, GraphQLMap.swift, JSON.swift, and NetworkTransport.swift, have been removed from this location. This deletion eliminates the core client implementation, network transport, and JSON parsing logic previously provided by these modules.

Apollo · 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 (such as HeroNameQuery, HeroDetailsQuery, and FragmentTypingQuery) and their associated fragment definitions. These handwritten API code files have been deleted, indicating a shift away from manual query definition in this test suite, likely in favor of generated code or a different testing approach.

ApolloTests · high confidence

Architecture

Apollo build configuration extracted to shared xcconfig files

The Xcode project configuration for the Apollo library and its subprojects (ApolloSQLite, ApolloWebSocket) has been refactored to use shared xcconfig files. This change centralizes build settings, ensuring consistent framework and test target configurations across Debug, Release, and Performance Testing schemes, and simplifies maintenance by inheriting common settings from the Shared directory.

Configuration/Apollo · high confidence

Centralized Xcode build configuration via xcconfig files

The project has extracted build settings from individual Xcode projects into a shared set of xcconfig files in Configuration/Shared. This change standardizes the build environment by defining common settings for Swift 5.0, deployment targets (iOS 12.0, macOS 10.14, tvOS 12.0, watchOS 5.0), code generation, linking, and packaging. It also introduces specific configurations for different target types (frameworks, applications, tests) and enables universal framework support across iOS, macOS, tvOS, and watchOS, including Catalyst support. Users will benefit from consistent build behavior and easier maintenance of build settings across the workspace.

Configuration/Shared · high confidence

Behavioural changes

Added Xcode schemes for Swift Package Manager testing

New Xcode scheme files have been added for the Apollo, ApolloCodegenLib, ApolloSQLite, and ApolloWebSocket targets to enable running tests via Swift Package Manager. The configuration for Apollo and ApolloSQLite explicitly skips SQLite-specific test cases (such as SQLiteFetchQueryTests and SQLiteStarWarsServerTests) when running the shared ApolloCacheDependentTests suite, while the ApolloWebSocket scheme configures an in-memory cache provider via environment variables to support its test execution.

.swiftpm/xcode/xcshareddata · high confidence

Apollo SDK refactored to use a chainable interceptor architecture

The Apollo client has been restructured to use a new request chain model built on \ApolloInterceptor\ and \InterceptorProvider\ protocols. This change introduces dedicated interceptors for cache reads (\CacheReadInterceptor\), cache writes (\CacheWriteInterceptor\), and automatic persisted queries (\AutomaticPersistedQueryInterceptor\), replacing the previous monolithic execution flow. Users benefit from a more modular networking stack that supports custom interceptor injection and clearer separation of concerns between caching, network transport, and response parsing.

Sources/Apollo · high confidence

Introduce internal JavaScript IR compiler for GraphQL code generation

The code generation frontend now includes a new internal JavaScript implementation that compiles GraphQL documents into an Intermediate Representation (IR), replacing the previous reliance on an external package. This change introduces a new compiler module that processes operations and fragments, defines the IR data structures (types, variables, selections), and exposes entry points for schema loading, document parsing, validation, and compilation. Users benefit from a self-contained codegen pipeline that no longer requires the external Apollo CLI for schema fetching or IR generation, with improved validation rules that enforce named operations and prevent \_\_typename aliasing.

Sources/ApolloCodegenLib/Frontend/JavaScript · high confidence

StarWarsAPI framework regenerated with updated codegen

The StarWarsAPI framework has been regenerated using an updated CLI and TypeScript codegen process. This update refreshes the generated Swift types, including the Episode enum and input structures like ReviewInput and ColorInput, and introduces a new CreateReviewForEpisodeMutation operation with a specific operation identifier. The framework module itself has been reorganized into the frameworks directory, ensuring the generated API client code remains consistent with the latest schema and tooling changes.

Sources/StarWarsAPI · high confidence

Updated Xcode schemes with code coverage, thread sanitizers, and test plans

The shared Xcode schemes for Apollo, ApolloCodegenLib, ApolloSQLite, ApolloUtils, ApolloWebSocket, and ApolloPerformanceTests have been updated to enable code coverage and thread sanitizers during testing. The main Apollo scheme now references specific test plans (Unit, Integration, Performance, CI) and sets an environment variable to configure the cache provider, while the ApolloAPI scheme was added to support the renamed framework target.

Apollo.xcodeproj/xcshareddata/xcschemes · high confidence

WebSocket transport refactored with new default implementations and protocol abstractions

The ApolloWebSocket module has been restructured to decouple the core WebSocket logic from the underlying network implementation. A new \WebSocketClient\ protocol and \WebSocketTransport\ class now define the public interface, while the concrete network handling is provided by new default implementations in the \DefaultImplementation\ directory, including \WebSocket.swift\, \WebSocketStream.swift\, \SSLClientCertificate.swift\, \SSLSecurity.swift\, and \Compression.swift\. This change introduces support for RFC 7692 compression, configurable SSL client certificates, and custom SSL trust validation. Additionally, the \SplitNetworkTransport\ has been updated to conform to \UploadingNetworkTransport\, enabling file uploads alongside standard HTTP requests and WebSocket subscriptions within a single transport instance.

Sources/ApolloWebSocket · high confidence

Xcode project file format and workspace configuration updated

The Xcode project file (project.pbxproj) has been upgraded from object version 46 to 54, reflecting changes in the Xcode project schema. Additionally, the workspace configuration file (contents.xcworkspacedata) was modified to update the file reference location from 'self:Apollo.xcodeproj' to 'self:'.

Apollo.xcodeproj · high confidence

Fixes

Add SPM workspace configuration for bundled JS dist directory

A new workspace file (contents.xcworkspacedata) has been added to the .swiftpm/xcode directory to support Swift Package Manager inclusion. This change ensures that the bundled JavaScript distribution directory is correctly referenced and included when the package is integrated via SPM, addressing previous issues with how the JS assets were bundled for Swift consumers.

.swiftpm/xcode/package.xcworkspace · high confidence

Test coverage

Added CI test plan configurations for Apollo; Added comprehensive test coverage for Apollo Cache subsystem; Added parsing performance tests for Apollo responses; Added test coverage for WebSocket compression and protocol implementations; Added test suite for Apollo codegen and schema download; Added unit tests for the new GraphQL codegen frontend; Expanded integration test coverage for Apollo client features; Expanded test coverage for Apollo client operations and caching; New ApolloCodegenTestSupport framework for codegen testing; Updated performance test baselines for parsing operations.

Dependencies

Initial dependency and package configuration for Apollo iOS

This change introduces the foundational package management configuration for the Apollo iOS library, establishing support for Swift Package Manager (SPM) and CocoaPods. It defines the \Package.swift\ manifest with platform targets (iOS 12, macOS 10.14, tvOS 12, watchOS 5) and declares dependencies on \SQLite.swift\ (version 0.13.1) for the \ApolloSQLite\ target. A corresponding \Apollo.podspec\ is added to support CocoaPods integration, including subspecs for Core, SQLite, and WebSocket functionality. Additionally, lockfiles (\Package.resolved\) are committed for the main project, Swift scripts, and the SimpleUploadServer utility to ensure reproducible builds for development tools and test infrastructure.

(dependencies) · high confidence

Housekeeping

Added Xcode workspace configuration files; Removed Xcode user-specific breakpoint configuration.

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

How this codebase got here

Score

  • CAI 50 → 51 (+0.8)
  • Rubric changed (rubric-2026.10.5 → rubric-2026.11.4) — scores are not directly comparable.

Lenses

  • Code Health 83 → 83 (-0.8)
  • Architecture 95 → 96 (+0.2)
  • Maturity 30 → 30 (+0.0)
  • Readiness 60 → 63 (+2.9)
  • Security 62 → 60 (-1.6)
  • Domain Modelling 86 → 86 (+0.0)
  • Performance 80 → 100 (+20.0)

Resolved (3)

  • Duplicated block (7 lines × 2) (Sources/Apollo/GraphQLSelectionSet.swift)
  • Duplicated block (8 lines × 2) (Sources/Apollo/GraphQLSelectionSet.swift)
  • High secret: WD-SECRET-0005 (docs/package-lock.json)

New (23)

  • Duplicated block (11 lines × 2) (Sources/Apollo/GraphQLSelectionSet.swift)
  • Duplicated block (7 lines × 2) (Sources/Apollo/GraphQLSelectionSet.swift)
  • Duplicated block (8 lines × 2) (Sources/Apollo/GraphQLSelectionSet.swift)
  • Edited copies of one member (3 members, 11+ corresponding lines) (Sources/ApolloCodegenTestSupport/CodegenTestHelper.swift)
  • Edited copies of one member (3 members, 15+ corresponding lines) (Sources/Apollo/ApolloStore.swift)
  • Edited copies of one member (3 members, 3+ corresponding lines) (Sources/Apollo/GraphQLResultAccumulator.swift)
  • Edited copies of one member (3 members, 3+ corresponding lines) (Sources/Apollo/GraphQLSelectionSet.swift)
  • Edited copy of a member (10 corresponding lines) (Sources/ApolloTestSupport/XCTAssertHelpers.swift)
  • Edited copy of a member (11 corresponding lines) (Sources/Apollo/Collection+Helpers.swift)
  • Edited copy of a member (11 corresponding lines) (Sources/Apollo/DefaultInterceptorProvider.swift)
  • Edited copy of a member (11 corresponding lines) (Sources/Apollo/GraphQLFile.swift)
  • Edited copy of a member (11 corresponding lines) (Sources/Apollo/MultipartFormData.swift)
  • Edited copy of a member (12 corresponding lines) (Sources/Apollo/RequestChain.swift)
  • Edited copy of a member (13 corresponding lines) (Sources/Apollo/RequestChainNetworkTransport.swift)
  • Edited copy of a member (14 corresponding lines) (Sources/Apollo/RequestChainNetworkTransport.swift)
  • Edited copy of a member (16 corresponding lines) (Sources/ApolloCodegenLib/ApolloSchemaDownloader.swift)
  • Edited copy of a member (20 corresponding lines) (Sources/Apollo/MaxRetryInterceptor.swift)
  • Edited copy of a member (3 corresponding lines) (Sources/Apollo/GraphQLResponseGenerator.swift)
  • Edited copy of a member (3 corresponding lines) (Sources/ApolloTestSupport/XCTAssertHelpers.swift)
  • Edited copy of a member (33 corresponding lines) (Sources/Apollo/RequestBodyCreator.swift)
  • …and 3 more

Written by cca.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 14 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 75e10a8b29a530e654398f3caceea4bc3c54a4dd — the exact code this score is about.
  • Scored under rubric-2026.11.4 — the same rubric and the same method as every other entry in this index.
  • Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.65+preprod-3c33c1882dc1.