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

Make filesystem diagram a bit easier to understand #2063

Merged
merged 2 commits into from
Dec 14, 2021
Merged
Changes from all commits
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
54 changes: 27 additions & 27 deletions docs/source/swift-scripting.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,22 +48,22 @@ When you unzip the downloaded repo, you'll see that there's a folder called **`A
If you're using the default target structure for an Xcode project, your project's file structure will look essentially like this in Finder:

```txt:title=Sample%20Project%20Structure
MyProject // Source root
| MyProject.xcodeproj
| - MyProject // Contains app target source files
| - MyLibraryTarget // Contains lib target source files
| - MyProjectTests // Contains test files
📂 MyProject // Source root
┃ 📄 MyProject.xcodeproj
┣ 📁 MyProject // Contains app target source files
┣ 📁 MyLibraryTarget // Contains lib target source files
┣ 📁 MyProjectTests // Contains test files
```

Drag the `ApolloCodegen` folder in at the same level as your other targets (in Finder, not in Xcode):
Drag the `ApolloCodegen` folder in **at the same level as your other targets** (in Finder, not in Xcode):

```txt:title=Sample%20Project%20Structure
MyProject // Source root
| MyProject.xcodeproj
| - MyProject // Contains app target source files
| - MyLibraryTarget // Contains lib target source files
| - MyProjectTests // Contains test files
| - ApolloCodegen // Contains the swift scripting files you just downloaded and dragged in
📂 MyProject // Source root
┃ 📄 MyProject.xcodeproj
┣ 📁 MyProject // Contains app target source files
┣ 📁 MyLibraryTarget // Contains lib target source files
┣ 📁 MyProjectTests // Contains test files
┣ 📁 ApolloCodegen // Contains the swift scripting files you just downloaded and dragged in
```

Double-click `Package.swift` in the `ApolloCodegen` folder to open the executable's package in Xcode.
Expand Down Expand Up @@ -140,13 +140,13 @@ swift run ApolloCodegen downloadSchema
If you're using the template code and following the sample project structure, the schema should download here:

```txt:title=Sample%20Project%20Structure
MyProject // SourceRoot
| MyProject.xcodeproj
| - MyProject // Contains app target source files
| schema.json // <-- downloaded schema
| - MyLibraryTarget // Contains lib target source files
| - MyProjectTests // Contains test files
| - ApolloCodegen // Contains Swift Scripting files
📂 MyProject // SourceRoot
┃ 📄 MyProject.xcodeproj
┣ 📂 MyProject // Contains app target source files
┃ ┃ 📄 schema.json // <-- downloaded schema
┣ 📁 MyLibraryTarget // Contains lib target source files
┣ 📁 MyProjectTests // Contains test files
┣ 📁 ApolloCodegen // Contains Swift Scripting files
```

Next, now that you have a schema, you need a GraphQL file with an operation in order to generate code.
Expand All @@ -158,14 +158,14 @@ If you're not familiar with creating an operation in graphQL, please check out t
Make sure you've added the operation file to the project files, ideally at or above the level of the `schema.json` (Otherwise, you'll need to manually pass the URL of your GraphQL files to your code generation step):

```txt:title=Sample%20Project%20Structure
MyProject // SourceRoot
| MyProject.xcodeproj
| - MyProject // Contains app target source files
| schema.json
| LaunchList.graphql
| - MyLibraryTarget // Contains lib target source files
| - MyProjectTests // Contains test files
| - ApolloCodegen // Contains Swift Scripting files
📂 MyProject // SourceRoot
┃ 📄 MyProject.xcodeproj
┣ 📂 MyProject // Contains app target source files
┃ ┃ 📄 schema.json
┃ ┃ 📄 LaunchList.graphql
┣ 📁 MyLibraryTarget // Contains lib target source files
┣ 📁 MyProjectTests // Contains test files
┣ 📁 ApolloCodegen // Contains Swift Scripting files
```

Here, for example, is what this looks like in a file for one of the queries in our [tutorial application](./tutorial/tutorial-introduction):
Expand Down