From fb6138bc883b033504f422b1305702270d13f474 Mon Sep 17 00:00:00 2001 From: Anthony Miller Date: Wed, 24 Apr 2024 11:27:05 -0700 Subject: [PATCH] Move fieldMerging option to experimental --- ...olloCodegenConfigurationCodableTests.swift | 3 --- .../ApolloCodegenConfiguration.swift | 21 +------------------ 2 files changed, 1 insertion(+), 23 deletions(-) diff --git a/Tests/ApolloCodegenTests/ApolloCodegenConfigurationCodableTests.swift b/Tests/ApolloCodegenTests/ApolloCodegenConfigurationCodableTests.swift index 3ea49dce6..65c56cfbe 100644 --- a/Tests/ApolloCodegenTests/ApolloCodegenConfigurationCodableTests.swift +++ b/Tests/ApolloCodegenTests/ApolloCodegenConfigurationCodableTests.swift @@ -116,9 +116,6 @@ class ApolloCodegenConfigurationCodableTests: XCTestCase { "inputObjects" : "none" }, "deprecatedEnumCases" : "exclude", - "fieldMerging" : [ - "all" - ], "markOperationDefinitionsAsFinal" : true, "operationDocumentFormat" : [ "definition" diff --git a/apollo-ios-codegen/Sources/ApolloCodegenLib/ApolloCodegenConfiguration.swift b/apollo-ios-codegen/Sources/ApolloCodegenLib/ApolloCodegenConfiguration.swift index a25628d97..d287bb7a2 100644 --- a/apollo-ios-codegen/Sources/ApolloCodegenLib/ApolloCodegenConfiguration.swift +++ b/apollo-ios-codegen/Sources/ApolloCodegenLib/ApolloCodegenConfiguration.swift @@ -466,8 +466,6 @@ public struct ApolloCodegenConfiguration: Codable, Equatable { public let schemaDocumentation: Composition /// Which generated selection sets should include generated initializers. public let selectionSetInitializers: SelectionSetInitializers - /// Which merged fields and named fragment accessors are generated. Defaults to `.all`. - public let fieldMerging: FieldMerging /// How to generate the operation documents for your generated operations. public let operationDocumentFormat: OperationDocumentFormat /// Customization options to be applie to the schema during code generation. @@ -517,7 +515,6 @@ public struct ApolloCodegenConfiguration: Codable, Equatable { public static let deprecatedEnumCases: Composition = .include public static let schemaDocumentation: Composition = .include public static let selectionSetInitializers: SelectionSetInitializers = [.localCacheMutations] - public static let fieldMerging: FieldMerging = [.all] public static let operationDocumentFormat: OperationDocumentFormat = .definition public static let schemaCustomization: SchemaCustomization = .init() public static let cocoapodsCompatibleImportStatements: Bool = false @@ -536,7 +533,6 @@ public struct ApolloCodegenConfiguration: Codable, Equatable { /// - schemaDocumentation: Whether schema documentation is added to the generated files. /// - selectionSetInitializers: Which generated selection sets should include /// generated initializers. - /// - fieldMerging: Which merged fields and named fragment accessors are generated. /// - operationDocumentFormat: How to generate the operation documents for your generated operations. /// - cocoapodsCompatibleImportStatements: Generate import statements that are compatible with /// including `Apollo` via Cocoapods. @@ -552,7 +548,6 @@ public struct ApolloCodegenConfiguration: Codable, Equatable { deprecatedEnumCases: Composition = Default.deprecatedEnumCases, schemaDocumentation: Composition = Default.schemaDocumentation, selectionSetInitializers: SelectionSetInitializers = Default.selectionSetInitializers, - fieldMerging: FieldMerging = Default.fieldMerging, operationDocumentFormat: OperationDocumentFormat = Default.operationDocumentFormat, schemaCustomization: SchemaCustomization = Default.schemaCustomization, cocoapodsCompatibleImportStatements: Bool = Default.cocoapodsCompatibleImportStatements, @@ -565,7 +560,6 @@ public struct ApolloCodegenConfiguration: Codable, Equatable { self.deprecatedEnumCases = deprecatedEnumCases self.schemaDocumentation = schemaDocumentation self.selectionSetInitializers = selectionSetInitializers - self.fieldMerging = fieldMerging self.operationDocumentFormat = operationDocumentFormat self.schemaCustomization = schemaCustomization self.cocoapodsCompatibleImportStatements = cocoapodsCompatibleImportStatements @@ -583,7 +577,6 @@ public struct ApolloCodegenConfiguration: Codable, Equatable { case deprecatedEnumCases case schemaDocumentation case selectionSetInitializers - case fieldMerging case apqs case operationDocumentFormat case schemaCustomization @@ -618,11 +611,6 @@ public struct ApolloCodegenConfiguration: Codable, Equatable { forKey: .selectionSetInitializers ) ?? Default.selectionSetInitializers - fieldMerging = try values.decodeIfPresent( - FieldMerging.self, - forKey: .fieldMerging - ) ?? Default.fieldMerging - operationDocumentFormat = try values.decodeIfPresent( OperationDocumentFormat.self, forKey: .operationDocumentFormat @@ -671,7 +659,6 @@ public struct ApolloCodegenConfiguration: Codable, Equatable { try container.encode(self.deprecatedEnumCases, forKey: .deprecatedEnumCases) try container.encode(self.schemaDocumentation, forKey: .schemaDocumentation) try container.encode(self.selectionSetInitializers, forKey: .selectionSetInitializers) - try container.encode(self.fieldMerging, forKey: .fieldMerging) try container.encode(self.operationDocumentFormat, forKey: .operationDocumentFormat) try container.encode(self.schemaCustomization, forKey: .schemaCustomization) try container.encode(self.cocoapodsCompatibleImportStatements, forKey: .cocoapodsCompatibleImportStatements) @@ -1507,8 +1494,7 @@ extension ApolloCodegenConfiguration.OutputOptions { /// - deprecatedEnumCases: How deprecated enum cases from the schema should be handled. /// - schemaDocumentation: Whether schema documentation is added to the generated files. /// - selectionSetInitializers: Which generated selection sets should include - /// generated initializers. - /// - fieldMerging: Which merged fields and named fragment accessors are generated. + /// generated initializers. /// - apqs: Whether the generated operations should use Automatic Persisted Queries. /// - cocoapodsCompatibleImportStatements: Generate import statements that are compatible with /// including `Apollo` via Cocoapods. @@ -1528,7 +1514,6 @@ extension ApolloCodegenConfiguration.OutputOptions { deprecatedEnumCases: ApolloCodegenConfiguration.Composition = Default.deprecatedEnumCases, schemaDocumentation: ApolloCodegenConfiguration.Composition = Default.schemaDocumentation, selectionSetInitializers: ApolloCodegenConfiguration.SelectionSetInitializers = Default.selectionSetInitializers, - fieldMerging: ApolloCodegenConfiguration.FieldMerging = Default.fieldMerging, apqs: ApolloCodegenConfiguration.APQConfig, cocoapodsCompatibleImportStatements: Bool = Default.cocoapodsCompatibleImportStatements, warningsOnDeprecatedUsage: ApolloCodegenConfiguration.Composition = Default.warningsOnDeprecatedUsage, @@ -1540,7 +1525,6 @@ extension ApolloCodegenConfiguration.OutputOptions { self.deprecatedEnumCases = deprecatedEnumCases self.schemaDocumentation = schemaDocumentation self.selectionSetInitializers = selectionSetInitializers - self.fieldMerging = fieldMerging self.operationDocumentFormat = apqs.operationDocumentFormat self.cocoapodsCompatibleImportStatements = cocoapodsCompatibleImportStatements self.warningsOnDeprecatedUsage = warningsOnDeprecatedUsage @@ -1561,7 +1545,6 @@ extension ApolloCodegenConfiguration.OutputOptions { /// - schemaDocumentation: Whether schema documentation is added to the generated files. /// - selectionSetInitializers: Which generated selection sets should include /// generated initializers. - /// - fieldMerging: Which merged fields and named fragment accessors are generated. /// - operationDocumentFormat: How to generate the operation documents for your generated operations. /// - cocoapodsCompatibleImportStatements: Generate import statements that are compatible with /// including `Apollo` via Cocoapods. @@ -1581,7 +1564,6 @@ extension ApolloCodegenConfiguration.OutputOptions { deprecatedEnumCases: ApolloCodegenConfiguration.Composition = Default.deprecatedEnumCases, schemaDocumentation: ApolloCodegenConfiguration.Composition = Default.schemaDocumentation, selectionSetInitializers: ApolloCodegenConfiguration.SelectionSetInitializers = Default.selectionSetInitializers, - fieldMerging: ApolloCodegenConfiguration.FieldMerging = Default.fieldMerging, operationDocumentFormat: ApolloCodegenConfiguration.OperationDocumentFormat = Default.operationDocumentFormat, cocoapodsCompatibleImportStatements: Bool = Default.cocoapodsCompatibleImportStatements, warningsOnDeprecatedUsage: ApolloCodegenConfiguration.Composition = Default.warningsOnDeprecatedUsage, @@ -1593,7 +1575,6 @@ extension ApolloCodegenConfiguration.OutputOptions { self.deprecatedEnumCases = deprecatedEnumCases self.schemaDocumentation = schemaDocumentation self.selectionSetInitializers = selectionSetInitializers - self.fieldMerging = fieldMerging self.operationDocumentFormat = operationDocumentFormat self.cocoapodsCompatibleImportStatements = cocoapodsCompatibleImportStatements self.warningsOnDeprecatedUsage = warningsOnDeprecatedUsage