Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ModelSchema pluralName changing to listPluralName and syncPluralName #944

Open
lawmicha opened this issue Oct 5, 2021 · 2 comments
Open
Labels
datastore Issues related to the DataStore Category feature-request A request for a new feature or an enhancement to an existing API or category. GraphQL API Issues related to the API (GraphQL) Category

Comments

@lawmicha
Copy link
Member

lawmicha commented Oct 5, 2021

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: aws-amplify/amplify-cli#8350
Codegen changes: aws-amplify/amplify-codegen#252
iOS changes: aws-amplify/amplify-swift#1451
Android tracking issue: aws-amplify/amplify-android#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

@HuiSF HuiSF added datastore Issues related to the DataStore Category breaking-change-for-next-major-version labels Oct 5, 2021
@ragingsquirrel3 ragingsquirrel3 added the GraphQL API Issues related to the API (GraphQL) Category label Oct 7, 2021
@Jordan-Nelson
Copy link
Member

@lawmicha Has this been finalized across iOS/Android and codegen?

@Jordan-Nelson Jordan-Nelson added feature-request A request for a new feature or an enhancement to an existing API or category. pending-community-response Pending response from the issue opener or other community members and removed breaking-change-for-next-major-version labels Mar 8, 2022
@lawmicha
Copy link
Member Author

lawmicha commented May 8, 2022

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 Feature: Use improved pluralization amplify-codegen#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 Feature: Use improved pluralization amplify-codegen#255

@Jordan-Nelson Jordan-Nelson added pending-community-response Pending response from the issue opener or other community members and removed pending-community-response Pending response from the issue opener or other community members labels Jun 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
datastore Issues related to the DataStore Category feature-request A request for a new feature or an enhancement to an existing API or category. GraphQL API Issues related to the API (GraphQL) Category
Projects
None yet
Development

No branches or pull requests

4 participants