Skip to content

Commit

Permalink
Move fieldMerging option to experimental
Browse files Browse the repository at this point in the history
  • Loading branch information
AnthonyMDev committed Jul 16, 2024
1 parent c2ac6d4 commit fb6138b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,6 @@ class ApolloCodegenConfigurationCodableTests: XCTestCase {
"inputObjects" : "none"
},
"deprecatedEnumCases" : "exclude",
"fieldMerging" : [
"all"
],
"markOperationDefinitionsAsFinal" : true,
"operationDocumentFormat" : [
"definition"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand All @@ -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.
Expand All @@ -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,
Expand All @@ -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
Expand All @@ -583,7 +577,6 @@ public struct ApolloCodegenConfiguration: Codable, Equatable {
case deprecatedEnumCases
case schemaDocumentation
case selectionSetInitializers
case fieldMerging
case apqs
case operationDocumentFormat
case schemaCustomization
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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.
Expand All @@ -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,
Expand All @@ -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
Expand All @@ -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.
Expand All @@ -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,
Expand All @@ -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
Expand Down

0 comments on commit fb6138b

Please sign in to comment.