Skip to content

Commit

Permalink
Make filesystem diagram a bit easier to understand (apollographql#2063)
Browse files Browse the repository at this point in the history
* Update ASCII art for filesystem, clarify where Apollo Codegen folder goes

* update spacing to make comments clearer, fix missing file emoji
  • Loading branch information
designatednerd authored and GlobakMaxim committed Jun 1, 2022
1 parent a46237d commit e931c51
Showing 1 changed file with 27 additions and 27 deletions.
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

0 comments on commit e931c51

Please sign in to comment.