Migrating to Apollo 1.0 for iOS
Article Summary
Scott Southerland from Thumbtack reveals how their iOS app hit a breaking point: 8-minute builds, mysterious crashes, and 80,000-line auto-generated files that finally stopped compiling altogether.
Thumbtack adopted Apollo iOS for GraphQL back in 2018, but by 2022 their code generation had spiraled out of control. The culprit? Apollo 0.5's fragment handling created exponentially more types instead of consolidating them, bloating their codebase until the Swift compiler literally gave up.
Key Takeaways
- Build times ballooned to 8 minutes with 80% spent compiling auto-generated GraphQL code
- Apollo 1.0 migration cut 80% of code lines and slashed release builds by 92%
- App binary size dropped 25% while fixing the mysterious Signal 9 crashes
- Fragment usage in old Apollo created 3 types instead of consolidating to 1
- Compiler finally hit internal limits and refused to build until upgrade completed
Migrating from Apollo 0.5 to 1.0 delivered an 80% code reduction, 92% faster release builds, and 25% smaller binaries while rescuing Thumbtack from a complete development standstill.
About This Article
Thumbtack's Apollo 0.5 code generator was creating duplicate nested types for every query that used fragments. This caused some auto-generated files to balloon to over 80,000 lines, forcing developers to disable the debugger just to avoid Signal 9 crashes when launching the simulator.
Scott Southerland's team upgraded to Apollo 1.0, which completely rewrote the code generator to stop creating redundant types from fragments. The migration wasn't simple though. They had to refactor test mocking, remove mutable response types, and update how the codebase handled nullability and enums.
Generated code dropped by over 80%. CI debug builds got 50% faster. Release builds improved by 92%. The app store binary shrank by 25%. After months of blocked development, Thumbtack could finally ship features again.