Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding migration guide for 1.6 #55

Merged
merged 2 commits into from
Oct 4, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions docs/source/migrations/1.6.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
title: Apollo iOS 1.6 migration guide
description: From 1.5 to 1.6
---

This guide describes the process of migrating your code from version 1.5 to version 1.6 of Apollo iOS. 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:** For more information on the project restructuring in the 1.6 release see [this](https://github.com/apollographql/apollo-ios/issues/3240) GitHub issue.

If you are doing your code generation through Swift you have something like the following in your `Package.swift` file:
BobaFetters marked this conversation as resolved.
Show resolved Hide resolved

```swift title="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:

```swift title="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"),
]
)
```