ModelSchema pluralName changing to listPluralName and syncPluralName
Describe the bug Due to CLI changes to how names are pluralized for list query operations, we're working on a backwards compatible fix for existing developers. Issue: https://github.com/aws-amplify/amplify-cli/issues/8350 Codegen changes: https://github.com/aws-amplify/amplify-codegen/issues/252 iOS changes: https://github.com/aws-amplify/amplify-ios/pull/1451 Android tracking issue: https://github.com/aws-amplify/amplify-android/issues/1521
This work will most likely result in deprecating pluralName for syncPluralName since we are introducing listPluralName for backwards compatability, and it would be confusing to keep pluralName. This changes how ModelSchemas are created in Flutter
Before
ModelSchema(name: "Post", pluralName:"Posts")
After
ModelSchema(name: "Post", listPluralName: "Posts", syncPluralName: "Posts:)
Flutter should wait until this change is finalized across iOS/Android and codegen before making this change. Codegen is also planning to stop generating pluralName since syncPluralName will be generated. This means the ModelSchema for new developers will be missing pluralName and requires the dependent libraries to use syncPluralName like:
sync: graphQLName = syncPluralName ?? pluralName ?? name + "s"
I think means that until Flutter makes the change to stop using pluralName, it will rely on the native libraries to continue falling back onto the pluralName for the sync query name. Since Flutter hasn't launched support for Amplify.API.query(.list) then there's no places that generates the list query name
@lawmicha Has this been finalized across iOS/Android and codegen?
The changes have been finalized to
- iOS / Android libraries are backwards compatible with the older properties being codegenerated, and have made the changes to support the new properties.
- now we're waiting for the codegen changes to be released here https://github.com/aws-amplify/amplify-codegen/pull/255 to actually generate the new properties
- The codegen changes went through a few iterations, initially we added the Flutter codegen changes and then removed it because the Flutter library needs to release a version of the library which handles both before we introduce the Flutter codegen changes. So whenever Flutter picks this up (see iOS and Android changes if more details is needed), then we can make the changes to codegen for dart codegen like in https://github.com/aws-amplify/amplify-codegen/pull/255