Skip to content

Conversation

@seang96
Copy link
Contributor

@seang96 seang96 commented Sep 14, 2020

Issue #, if available: #6500

Description of changes:
This is based off of ondojo's initial PR tagged above.
I added a new field that gets stored in the schema generated from @aws-amplify/cli called isArrayRequired.
PR to update @aws-amplify/cli - aws-amplify/amplify-cli#5327
I added tests for the nullable arrays

This PR should support the table below:

declaration null [] [null] [{ foo: 'BAR' }]
[Type!]! no yes no yes
[Type]! no yes yes yes
[Type!] yes yes no yes
[Type] yes yes yes yes

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

@lgtm-com
Copy link

lgtm-com bot commented Sep 14, 2020

This pull request introduces 1 alert when merging 9a763a7 into 6abbf50 - view on LGTM.com

new alerts:

  • 1 for Unused variable, import, function or class

@codecov
Copy link

codecov bot commented Sep 14, 2020

Codecov Report

Merging #6784 into main will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #6784   +/-   ##
=======================================
  Coverage   73.34%   73.34%           
=======================================
  Files         213      213           
  Lines       13159    13165    +6     
  Branches     2568     2571    +3     
=======================================
+ Hits         9651     9656    +5     
- Misses       3314     3315    +1     
  Partials      194      194           
Impacted Files Coverage Δ
packages/datastore/src/types.ts 84.74% <ø> (ø)
packages/datastore/src/datastore/datastore.ts 85.02% <100.00%> (-0.03%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e43e181...0e457ec. Read the comment docs.

@iartemiev iartemiev self-requested a review September 21, 2020 00:30
Copy link
Member

@iartemiev iartemiev left a comment

Choose a reason for hiding this comment

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

Looks great! Just a minor naming change requested

| EnumFieldType;
isArray: boolean;
isRequired?: boolean;
isArrayRequired?: boolean;
Copy link
Member

Choose a reason for hiding this comment

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

Hey @seang96, thank you so much for this PR! I talked it over with @yuth from the CLI team and we wanted to see if you could change isArrayRequired -> isArrayNullable in this PR, as well as in your related CLI PR.
We'll merge both PRs promptly once the change has been made.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hey @seang96, thank you so much for this PR! I talked it over with @yuth from the CLI team and we wanted to see if you could change isArrayRequired -> isArrayNullable in this PR, as well as in your related CLI PR.
We'll merge both PRs promptly once the change has been made.

I pushed the respective changes! Sorry for the delay, got caught up in other projects.

Copy link
Member

Choose a reason for hiding this comment

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

No worries, thanks for updating! We should flip the behavior as well though since isNullable has effectively the opposite meaning of isRequired, i.e. where you had isArrayRequired should now be !isArrayNullable. Sorry for the confusion.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No problem, I did not think about the implications for the name change haha. Commit is pushed.

@github-actions
Copy link

This pull request has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs.

Looking for a help forum? We recommend joining the Amplify Community Discord server *-help channels or Discussions for those types of questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 27, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants