Skip to content

Commit 72ec525

Browse files
Merge pull request #708 from apollographql/docs/bashprofile
Installation docs update + cleanup
2 parents 47828af + 3c11c59 commit 72ec525

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

docs/source/installation.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,10 +194,16 @@ cd "${SRCROOT}/${TARGET_NAME}"
194194

195195
## Build your target
196196

197-
At this point, you can try building your target in Xcode. This will verify that the `schema.json` file can be found by the `apollo` script created above.
197+
At this point, you can try building your target in Xcode. This will verify that the `schema.json` file can be found by the `apollo` script created above, and run the codegen.
198198

199199
### Troubleshooting
200200

201+
If you've installed `apollo` globally with NPM and the script still seems to be having trouble finding it, add the following to the beginning of your Run Script Build Phase:
202+
203+
```bash
204+
source ~/.bash_profile
205+
```
206+
201207
If you get this error:
202208

203209
> Cannot find GraphQL schema file [...]
@@ -210,13 +216,16 @@ If you get this error:
210216
211217
If you don't have any `.graphql` files in your build tree, and you need to create at least `.graphql` file with a valid query.
212218

219+
If you get this error:
220+
213221
> Ensure that there is only one instance of "graphql" in the node_modules directory. If different versions of "graphql" are the dependencies of other relied on modules, use "resolutions" to ensure only one version is installed.
214-
```
215222
216223
Delete the `node_modules` folder in your source root and rebuild.
217224

218225
## Adding the generated API file to your target
219226

220-
1. Drag the generated `API.swift` file to your target.
227+
Drag the generated `API.swift` file to your target.
221228

222229
> Note that because Apollo iOS generates query-specific result types, `API.swift` will be mostly empty at this point unless you've already added some `.graphql` files with queries or mutations to your target directory.
230+
231+
Make sure to uncheck the "Copy Files If Needed" checkbox, since it should already be within your project's folder system. Then, make sure you've checked all the Targets the API file needs to be included in.

0 commit comments

Comments
 (0)