aws-amplify / amplify-swift

A declarative library for application development using cloud services.
Apache License 2.0
456 stars 198 forks source link

Pending Release: Use Improved Pluralization #3135

Closed lawmicha closed 1 year ago

lawmicha commented 1 year ago

Describe the bug

This issue is to track the release of Improved Pluralization in https://github.com/aws-amplify/amplify-codegen/pull/255

We have a few issues that are open that will be referenced in this issue, while closing them in favor of tracking this issue.

Steps To Reproduce

N/A

Expected behavior

N/A

Amplify Framework Version

N/A

Amplify Categories

API

Dependency manager

Swift PM

Swift version

N/A

CLI version

N/A

Xcode version

N/A

Relevant log output

<details>
<summary>Log Messages</summary>

INSERT LOG MESSAGES HERE



### Is this a regression?

Yes

### Regression additional context

_No response_

### Platforms

_No response_

### OS Version

N/A

### Device

N/A

### Specific to simulators

_No response_

### Additional context

_No response_
github-actions[bot] commented 1 year ago

This issue was opened by a maintainer of this repository; updates will be posted here. If you are also experiencing this issue, please comment here with any relevant information so that we're aware and can prioritize accordingly.

lawmicha commented 1 year ago

https://github.com/aws-amplify/amplify-swift/issues/1707#issuecomment-1079413894

lawmicha commented 1 year ago

https://github.com/aws-amplify/amplify-swift/issues/1443

lawmicha commented 1 year ago

https://github.com/aws-amplify/amplify-swift/issues/1505

lawmicha commented 1 year ago

https://github.com/aws-amplify/amplify-swift/issues/1841

lawmicha commented 1 year ago

https://github.com/aws-amplify/amplify-swift/issues/2460

shawnyapa commented 1 year ago

Appreciate the attention to fix this. I have personally run into this issue and had to work around it. Is there an approximate ETA for the CLI tool release that will include this fix?

lawmicha commented 1 year ago

Hey @shawnyapa, please track the codegen changes for swift in https://github.com/aws-amplify/amplify-codegen/pull/667 (it was merged in today!)

lawmicha commented 1 year ago

Using Amplify CLI version 12.4.0 Tested with the following schema, gathered from the various issues open.

# This "input" configures a global authorization rule to enable public access to
# all models in this schema. Learn more about authorization rules here: https://docs.amplify.aws/cli/graphql/authorization-rules
input AMPLIFY { globalAuthRule: AuthRule = { allow: public } } # FOR TESTING ONLY!

type NoteData @model {
    id: ID!
    name: String!
    description: String
    image: String
}

type Activity @model {
    id: ID!
    name: String
}

type EventNews @model {
    id: ID!
    name: String
}

type Protocols @model {
    id: ID!
    name: String
}

amplify codegen models

 model.listPluralName = "Activities"
    model.syncPluralName = "Activities"

    model.listPluralName = "EventNews"
    model.syncPluralName = "EventNews"

    model.listPluralName = "NoteData"
    model.syncPluralName = "NoteData"

  model.listPluralName = "Protocols"
    model.syncPluralName = "Protocols"

Looking over the AppSync operations

image

The library will make use of the properties listPluralName to create the list<Model> operation string. Activites, EventNews, NoteData, Protocols matches

lawmicha commented 1 year ago

For customers impacted by this, please use Amplify CLI 12.4.0 or greater to get the fix for the pluralization issue, and re-run codegen amplify codegen models

sebsto commented 1 year ago

I confirm this is working for me. Thanks