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

fix: CPK has-many has-one associatedFields #2735

Closed
wants to merge 1 commit into from

Conversation

lawmicha
Copy link
Member

@lawmicha lawmicha commented Feb 2, 2023

Issue #

Table of contents

Description

This PR does not attempt to fix the uni-directional has-many lazy loading list issue, see #2730 for more details and the fix. Since the CPK codegen changes (aws-amplify/amplify-codegen#538 ) are available in main, this PR introduces that parameter to make sure newly generated types continue to compile with the added associatedWithFields argument to hasMany model fields. When we are ready to move forward the lazy loading feature branch #2658 , the fix will be included as well

We are also fixing uni-directional has-one CPK use case by extending has-one with associatedFields. Corresponding codegen changes are in aws-amplify/amplify-codegen#541

General Checklist

  • Added new tests to cover change, if needed
  • Build succeeds with all target using Swift Package Manager
  • All unit tests pass
  • All integration tests pass
  • Security oriented best practices and standards are followed (e.g. using input sanitization, principle of least privilege, etc)
  • Documentation update for the change if required
  • PR title conforms to conventional commit style
  • New or updated tests include Given When Then inline code documentation and are named accordingly testThing_condition_expectation()
  • If breaking change, documentation/changelog update with migration instructions

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@lawmicha lawmicha requested a review from a team as a code owner February 2, 2023 21:35
@lawmicha lawmicha changed the title fix: CPK has-many targetNames fix: CPK has-many associatedWithFields Feb 2, 2023
@lawmicha lawmicha changed the title fix: CPK has-many associatedWithFields fix: CPK has-many associatedFields Feb 2, 2023
@lawmicha lawmicha force-pushed the v2.has-many-target-names branch 3 times, most recently from f9cbd7a to 490e63e Compare February 3, 2023 13:56
5d
5d previously approved these changes Feb 3, 2023
Copy link
Member

@5d 5d left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lawmicha lawmicha changed the title fix: CPK has-many associatedFields fix: CPK has-many has-one associatedFields Feb 3, 2023
@lawmicha lawmicha requested a review from 5d February 3, 2023 21:57
@lawmicha
Copy link
Member Author

lawmicha commented Feb 7, 2023

We will not move foward with this PR as the necessary changes are in data-dev-preview and will be merged to main soon

@lawmicha lawmicha closed this Feb 7, 2023
@lawmicha lawmicha deleted the v2.has-many-target-names branch November 6, 2023 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants