Skip to content

Commit 36cea8e

Browse files
designatednerdabernix
authored andcommitted
Revert PR #656 (#1464)
* Revert changes from #656 which were causing build issues on iOS * Update changelog
1 parent 1907dc3 commit 36cea8e

3 files changed

Lines changed: 5 additions & 17 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
- <First `apollo-codegen-flow` related entry goes here>
1111
- `apollo-codegen-scala`
1212
- <First `apollo-codegen-scala` related entry goes here>
13-
- `apollo-codegen-swift`
14-
- <First `apollo-codegen-swift` related entry goes here>
13+
- `apollo-codegen-swift`
14+
- Revert changes from [#656](https://github.com/apollographql/apollo-tooling/pull/656) due to build issues not caught by tests.
1515
- `apollo-codegen-typescript`
1616
- <First `apollo-codegen-typescript` related entry goes here>
1717
- `apollo-env`

packages/apollo-codegen-swift/src/__tests__/__snapshots__/codeGeneration.ts.snap

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1068,9 +1068,7 @@ exports[`Swift code generation #structDeclarationForFragment() should generate a
10681068
/// The friends of the character, or an empty list if they have none
10691069
public var friends: [Friend?]? {
10701070
get {
1071-
return (resultMap[\\"friends\\"] as? [ResultMap?]).flatMap { (value: [ResultMap?]) -> [Friend?] in value.map { (value: ResultMap?) -> Friend? in value.flatMap { (value: ResultMap) -> Friend in Friend(unsafeResultMap: value) } } }.filter({
1072-
Friend.possibleTypes.contains($0.__typename)
1073-
})
1071+
return (resultMap[\\"friends\\"] as? [ResultMap?]).flatMap { (value: [ResultMap?]) -> [Friend?] in value.map { (value: ResultMap?) -> Friend? in value.flatMap { (value: ResultMap) -> Friend in Friend(unsafeResultMap: value) } } }
10741072
}
10751073
set {
10761074
resultMap.updateValue(newValue.flatMap { (value: [Friend?]) -> [ResultMap?] in value.map { (value: Friend?) -> ResultMap? in value.flatMap { (value: Friend) -> ResultMap in value.resultMap } } }, forKey: \\"friends\\")
@@ -1222,9 +1220,7 @@ exports[`Swift code generation #structDeclarationForSelectionSet() should genera
12221220
/// The friends of the character, or an empty list if they have none
12231221
public var friends: [Friend?]? {
12241222
get {
1225-
return (resultMap[\\"friends\\"] as? [ResultMap?]).flatMap { (value: [ResultMap?]) -> [Friend?] in value.map { (value: ResultMap?) -> Friend? in value.flatMap { (value: ResultMap) -> Friend in Friend(unsafeResultMap: value) } } }.filter({
1226-
Friend.possibleTypes.contains($0.__typename)
1227-
})
1223+
return (resultMap[\\"friends\\"] as? [ResultMap?]).flatMap { (value: [ResultMap?]) -> [Friend?] in value.map { (value: ResultMap?) -> Friend? in value.flatMap { (value: ResultMap) -> Friend in Friend(unsafeResultMap: value) } } }
12281224
}
12291225
set {
12301226
resultMap.updateValue(newValue.flatMap { (value: [Friend?]) -> [ResultMap?] in value.map { (value: Friend?) -> ResultMap? in value.flatMap { (value: Friend) -> ResultMap in value.resultMap } } }, forKey: \\"friends\\")

packages/apollo-codegen-swift/src/codeGeneration.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -727,15 +727,7 @@ export class SwiftAPIGenerator extends SwiftGenerator<CompilerContext> {
727727
expression,
728728
"ResultMap",
729729
structName
730-
)}.filter`
731-
);
732-
this.withinBlock(
733-
() =>
734-
this.printOnNewline(
735-
`${structName}.possibleTypes.contains($0.__typename)`
736-
),
737-
"({",
738-
"})"
730+
)}`
739731
);
740732
});
741733
this.printOnNewline("set");

0 commit comments

Comments
 (0)