-
Notifications
You must be signed in to change notification settings - Fork 749
Closed
apollographql/apollo-ios-dev
#682Labels
Description
Summary
After updating from 1.17.0 to 1.22.0, our codegen script started getting a depreciation warning when calling the init for ApolloCodegenConfiguration.OutputOptions.
It appears to happing because all the parameters have a default value and we're only passing a subset thats common between the current and deprecated inits. The compiler seems to be defaulting to the deprecated init and giving the warning.
This could be a case where the deprecated inits should be marked @_disfavoredOverload so the compiler will try to use the current init first.
Version
1.22.0
Steps to reproduce the behavior
We're calling the init with the following parameters.
.init(
deprecatedEnumCases: .exclude,
operationDocumentFormat: [.definition, .operationId],
pruneGeneratedFiles: false,
markOperationDefinitionsAsFinal: true
)
Changing the init to have a parameter that's unique to the new init removes the warning.
.init(
deprecatedEnumCases: .exclude,
operationDocumentFormat: [.definition, .operationId],
reduceGeneratedSchemaTypes: false,
pruneGeneratedFiles: false,
markOperationDefinitionsAsFinal: true
)
Logs
app/Sources/ApolloCommand/Apollo+Codegen.swift:66:27 'init(additionalInflectionRules:deprecatedEnumCases:schemaDocumentation:selectionSetInitializers:operationDocumentFormat:schemaCustomization:cocoapodsCompatibleImportStatements:warningsOnDeprecatedUsage:conversionStrategies:pruneGeneratedFiles:markOperationDefinitionsAsFinal:appendSchemaTypeFilenameSuffix:)' is deprecated: replaced by 'init(additionalInflectionRules:queryStringLiteralFormat:deprecatedEnumCases:schemaDocumentation:selectionSetInitializers:operationDocumentFormat:schemaCustomization:reduceGeneratedSchemaTypes:cocoapodsCompatibleImportStatements:warningsOnDeprecatedUsage:conversionStrategies:pruneGeneratedFiles:markOperationDefinitionsAsFinal:appendSchemaTypeFilenameSuffix:)'Anything else?
No response