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: Arrays returned as objects #12676

Merged
merged 4 commits into from
Dec 6, 2023
Merged

Conversation

stocaaro
Copy link
Contributor

@stocaaro stocaaro commented Dec 5, 2023

Description of changes

When customers retrieve models with a.string().array() fields, the content has been repackage as objects.

Testing shows that this doesn't impact direct client.graphql(...) calls.

This change adds a test that fails without the corresponding fix to the flatten logic, correcting it to not translate Array's into Record type objects.

Issue #, if available

Description of how you validated changes

  • Manually tested in an app
  • Added unit test coverage, confirming repro failure

Checklist

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

@stocaaro stocaaro requested a review from a team as a code owner December 5, 2023 18:58
Copy link
Contributor

@svidgen svidgen left a comment

Choose a reason for hiding this comment

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

Thinking about concern raised OOB

Copy link
Contributor

@svidgen svidgen left a comment

Choose a reason for hiding this comment

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

Meant to flip to not approved while we/I think

@stocaaro stocaaro requested a review from svidgen December 5, 2023 20:21
Copy link
Contributor

@svidgen svidgen left a comment

Choose a reason for hiding this comment

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

OK. Re-approving. I think this is OK. But, would be great if we could get some test coverage around custom selection set to give us more confidence without the extra manual validation next time these LOC are touched.

@stocaaro stocaaro merged commit 8d9b94c into aws-amplify:main Dec 6, 2023
30 checks passed
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

3 participants