Here's your chance to speak at GraphQL Summit in New York City, October 8 - 10, 2024! 🏙️ Submit your proposal by May 20.
Docs
Launch GraphOS Studio

Apollo iOS 1.6 migration guide

From 1.5 to 1.6


This guide describes the process of migrating your code from version 1.5 to version 1.6 of . Please follow the relevant migration guides if you're on a version other than 1.5.

Apollo Codegen SPM Package

The 1.6 update restructured the Apollo iOS ecosystem by splitting the code up into multiple different repositories/packages. One of these changes was the creation of the new apollo-ios-codegen repo and SPM package for users who want to do their code generation through Swift vs using the CLI tool.

Note: If you use the CLI tool for code generation, this change does not affect you. For more information on the project restructuring in the 1.6 release see this GitHub issue.

If you are doing your code generation through Swift you have something like the following in your Package.swift file:

Package.swift
let package = Package(
name: "MyCodegen",
platforms: [.macOS(.v10_15)],
dependencies: [
.package(url: "https://github.com/apollographql/apollo-ios", exact: "1.5.0")
],
targets: [
.executableTarget(
name: "MyCodegen",
dependencies: [
.product(name: "ApolloCodegenLib", package: "apollo-ios"),
],
path: "Sources"),
]
)

In order to keep your code building successfully in the 1.6 release you will need to use the new apollo-ios-codegen package instead of the apollo-ios package:

Package.swift
let package = Package(
name: "MyCodegen",
platforms: [.macOS(.v10_15)],
dependencies: [
.package(url: "https://github.com/apollographql/apollo-ios-codegen", exact: "1.6.0")
],
targets: [
.executableTarget(
name: "MyCodegen",
dependencies: [
.product(name: "ApolloCodegenLib", package: "apollo-ios-codegen"),
],
path: "Sources"),
]
)
Previous
v1.5
Next
v1.7
Edit on GitHubEditForumsDiscord

© 2024 Apollo Graph Inc.

Privacy Policy

Company