Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for swift 5.1 compiler warning when type is an enum with a none case #1482

Merged
merged 2 commits into from
Sep 12, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
designatednerd marked this conversation as resolved.
Show resolved Hide resolved
- `apollo-codegen-typescript`
- Replace instanceof checks with their respective predicates [#1518](https://github.com/apollographql/apollo-tooling/pull/1518)
- `apollo-env`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1826,7 +1826,7 @@ public struct ReviewInput: GraphQLMapConvertible {
/// Comment about the movie, optional
public var commentary: Swift.Optional<String?> {
get {
return graphQLMap[\\"commentary\\"] as? Swift.Optional<String?> ?? .none
return graphQLMap[\\"commentary\\"] as? Swift.Optional<String?> ?? Swift.Optional<String?>.none
}
set {
graphQLMap.updateValue(newValue, forKey: \\"commentary\\")
Expand All @@ -1836,7 +1836,7 @@ public struct ReviewInput: GraphQLMapConvertible {
/// Favorite color, optional
public var favoriteColor: Swift.Optional<ColorInput?> {
get {
return graphQLMap[\\"favorite_color\\"] as? Swift.Optional<ColorInput?> ?? .none
return graphQLMap[\\"favorite_color\\"] as? Swift.Optional<ColorInput?> ?? Swift.Optional<ColorInput?>.none
}
set {
graphQLMap.updateValue(newValue, forKey: \\"favorite_color\\")
Expand Down
2 changes: 1 addition & 1 deletion packages/apollo-codegen-swift/src/codeGeneration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1193,7 +1193,7 @@ export class SwiftAPIGenerator extends SwiftGenerator<CompilerContext> {
this.printOnNewline(
swift`return graphQLMap[${SwiftSource.string(
name
)}] as? ${typeName} ?? .none`
)}] as? ${typeName} ?? ${typeName}.none`
);
} else {
this.printOnNewline(
Expand Down