Skip to content
This repository was archived by the owner on Nov 14, 2018. It is now read-only.

Commit 2baa151

Browse files
stefanceriuminbi
authored andcommitted
Fixes/undeclared type errors (#14)
Fixes undeclared type errors when generating Swift enumerations, removed the Apollo module name as it doesn’t exist in this context.
1 parent 1220e0c commit 2baa151

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/swift/codeGeneration.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -746,7 +746,7 @@ export class SwiftAPIGenerator extends SwiftGenerator<CompilerContext> {
746746

747747
this.printNewlineIfNeeded();
748748
this.comment(description);
749-
this.printOnNewline(`public enum ${name}: RawRepresentable, Equatable, Apollo.JSONDecodable, Apollo.JSONEncodable`);
749+
this.printOnNewline(`public enum ${name}: RawRepresentable, Equatable, JSONDecodable, JSONEncodable`);
750750
this.withinBlock(() => {
751751
this.printOnNewline('public typealias RawValue = String')
752752

test/swift/__snapshots__/codeGeneration.ts.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1427,7 +1427,7 @@ exports[`Swift code generation #structDeclarationForSelectionSet() should genera
14271427
`;
14281428
14291429
exports[`Swift code generation #typeDeclarationForGraphQLType() should escape identifiers in cases of enum declaration for a GraphQLEnumType 1`] = `
1430-
"public enum AlbumPrivacies: RawRepresentable, Equatable, Apollo.JSONDecodable, Apollo.JSONEncodable {
1430+
"public enum AlbumPrivacies: RawRepresentable, Equatable, JSONDecodable, JSONEncodable {
14311431
public typealias RawValue = String
14321432
case \`public\`
14331433
case \`private\`
@@ -1504,7 +1504,7 @@ public struct ReviewInput: GraphQLMapConvertible {
15041504
15051505
exports[`Swift code generation #typeDeclarationForGraphQLType() should generate an enum declaration for a GraphQLEnumType 1`] = `
15061506
"/// The episodes in the Star Wars trilogy
1507-
public enum Episode: RawRepresentable, Equatable, Apollo.JSONDecodable, Apollo.JSONEncodable {
1507+
public enum Episode: RawRepresentable, Equatable, JSONDecodable, JSONEncodable {
15081508
public typealias RawValue = String
15091509
/// Star Wars Episode IV: A New Hope, released in 1977.
15101510
case newhope

0 commit comments

Comments
 (0)