apollographql / apollographql/apollo-tooling

[Swift] Errors are not formatted to allow Xcode to show them inline.

Open
#1,264 5 comments 0 reactions 1 assignee Claimed by @designatednerd View on GitHub
:bird: component - swift :x: errors 🤖 component - codegen
Dominant language
TypeScript
Stars
3k
Forks
460
PR merge metrics
No merged PRs in 30d

Description

**Intended outcome:**
When there is an error running the codeine step, clicking on one of the errors should take you to the file with the error and show it inline.

**Actual outcome:**
Clicking on the error does nothing and there is no error shown in the file.

**How to reproduce the issue:**
- Create a `graphql` file that causes an error to occur, I'm my case it was due to an unknown type.
- run the Apollo codegen and pass in the query
- try clicking on the created error or open the file to try and see the error

It appears to be caused by the error string that's generated. It doesn't contain an absolute path so Xcode won't display the error. The following error message shows the same issue
```
echo "Path/To/File.graphql:1: error: Something went wrong."
```

Changing the error message to be the absolute path to the file shows the error as expected.
```
echo "${SRCROOT}/Path/To/File.graphql:1: error: Something went wrong."
```

**Versions**
It looks like the Apollo-iOS project installs 1.9.2

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.