-
Notifications
You must be signed in to change notification settings - Fork 198
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
.paginatedList() query fails with Model that has name ending in y #1707
Comments
Hi @louiss98, thank you for bringing this to our attention. I provisioned a backend with a If we are seeing The workaround that you described is the correct workaround for now. By manually adding // model.pluralName = "Stories" // remove this
model.listPluralName = "Stories" // add this for your use case
model.syncPluralName = "Stories" // this will be generated as well with the fix Once this CLI fix is released, you can upgrade to the latest CLI and it will generate those fields for you automatically. |
Please track #3135 |
Please use Amplify CLI 12.4.0 or greater to get the fix for the pluralization issue |
Describe the bug
On generated Model+Schema files, model.listPluralName is never set causing an undefined field error with paginatedList queries.
Steps To Reproduce
Expected behavior
Generated Model+Schema to contain a generated listPluralName.
Amplify Framework Version
1.22.0
Amplify Categories
API
Dependency manager
Swift PM
Swift version
4.2
CLI version
7.6.25
Xcode version
13.2.1
Relevant log output
No response
Is this a regression?
No
Regression additional context
No response
Device
iPhone 8 Simulator
iOS Version
iOS 12.1
Specific to simulators
No response
Additional context
Since there is no listPluralName set the query defaults to
(queryType.rawValue + name).pluralize()
resulting in an invalid field when the model name ends in y. For example Storys as opposed to Stories.ModelSchema file generates a pluralName instead of syncPluralName and listPluralName
The text was updated successfully, but these errors were encountered: