diff --git a/CHANGELOG.md b/CHANGELOG.md index f562a9fd09..41e02b8ae9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ - `apollo-codegen-swift` - Replace instanceof checks with their respective predicates [#1518](https://github.com/apollographql/apollo-tooling/pull/1518) - Ensure types and strings are properly escaped in all generated code [#1515](https://github.com/apollographql/apollo-tooling/pull/1515) + - Fix warning in Xcode 11 when enums have a none case [#1482](https://github.com/apollographql/apollo-tooling/pull/1482) - `apollo-codegen-typescript` - Replace instanceof checks with their respective predicates [#1518](https://github.com/apollographql/apollo-tooling/pull/1518) - `apollo-env` diff --git a/packages/apollo-codegen-swift/src/__tests__/__snapshots__/codeGeneration.ts.snap b/packages/apollo-codegen-swift/src/__tests__/__snapshots__/codeGeneration.ts.snap index 69e6149552..5e62ebc1cb 100644 --- a/packages/apollo-codegen-swift/src/__tests__/__snapshots__/codeGeneration.ts.snap +++ b/packages/apollo-codegen-swift/src/__tests__/__snapshots__/codeGeneration.ts.snap @@ -1826,7 +1826,7 @@ public struct ReviewInput: GraphQLMapConvertible { /// Comment about the movie, optional public var commentary: Swift.Optional { get { - return graphQLMap[\\"commentary\\"] as? Swift.Optional ?? .none + return graphQLMap[\\"commentary\\"] as? Swift.Optional ?? Swift.Optional.none } set { graphQLMap.updateValue(newValue, forKey: \\"commentary\\") @@ -1836,7 +1836,7 @@ public struct ReviewInput: GraphQLMapConvertible { /// Favorite color, optional public var favoriteColor: Swift.Optional { get { - return graphQLMap[\\"favorite_color\\"] as? Swift.Optional ?? .none + return graphQLMap[\\"favorite_color\\"] as? Swift.Optional ?? Swift.Optional.none } set { graphQLMap.updateValue(newValue, forKey: \\"favorite_color\\") diff --git a/packages/apollo-codegen-swift/src/codeGeneration.ts b/packages/apollo-codegen-swift/src/codeGeneration.ts index be9fcbce7d..1fa00248bf 100644 --- a/packages/apollo-codegen-swift/src/codeGeneration.ts +++ b/packages/apollo-codegen-swift/src/codeGeneration.ts @@ -1193,7 +1193,7 @@ export class SwiftAPIGenerator extends SwiftGenerator { this.printOnNewline( swift`return graphQLMap[${SwiftSource.string( name - )}] as? ${typeName} ?? .none` + )}] as? ${typeName} ?? ${typeName}.none` ); } else { this.printOnNewline(