apollographql / apollographql/apollo-tooling
Code generation is creating Swift code that won't compile in 4.0 or 4.2
- Dominant language
- TypeScript
- Stars
- 3k
- Forks
- 460
- PR merge metrics
- No merged PRs in 30d
Description
The following query seems to be generating code that isn't valid.
```graphql
query WirelessInfoQuery($listingId: Long!) {
miso {
wirelessInfos(request: { listingId: $listingId }) {
wirelessInfos {
...WirelessInfo
}
}
}
}
mutation WirelessInfoWrite($listingId: Long!, $wirelessInfo: [MisoWirelessInfoWriteOnlyInput]){
miso {
updateWirelessInfos(request: {
listingId: $listingId
wirelessInfos: $wirelessInfo
}) {
wirelessInfos {
...WirelessInfo
}
}
}
}
fragment WirelessInfo on MisoWirelessInfoReadOnly {
id
wirelessSsid
wirelessPassword
wirelessType
}
```

I am using Apollo 0.9.5.
You will notice in the leading side panel that there are a few other failures as well.
Let me know what other info I can provide to help debug this.
Contributor guide
Research direction
No source file or test is named. Start by reproducing the GraphQL query and mutation with Apollo 0.9.5, then inspect the generated Swift output and the compiler failures under Swift 4.0 and 4.2. Done means the generated code compiles in both versions and the other reported failures are understood or covered.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- graphql, swift, typescript
- Domain
- developer-experience, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100