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

feat(core): add granular model read operations #2611

Merged
merged 1 commit into from May 4, 2023

Conversation

AaronZyLee
Copy link
Contributor

@AaronZyLee AaronZyLee commented Jan 31, 2023

Issue #, if available:
Fix #2526
The purpose of adding enum in library is to ensure the model files generated by modelgen will be compiled. However, this is not intended for Datastore usage but for those who use modelgen files along with API plugin. It is not recommended to use them in the datastore due to the prerequisite of sync and listen. This is documented in the callout.
Description of changes:
Add granular read operation enums in model auth operation rule
Refer https://docs.amplify.aws/cli/graphql/authorization-rules/#how-it-works

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@codecov-commenter
Copy link

codecov-commenter commented Jan 31, 2023

Codecov Report

Merging #2611 (9b7f4b9) into main (136abe1) will not change coverage.
The diff coverage is n/a.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@           Coverage Diff           @@
##             main    #2611   +/-   ##
=======================================
  Coverage   45.70%   45.70%           
=======================================
  Files         360      360           
  Lines       10928    10928           
=======================================
  Hits         4995     4995           
  Misses       5933     5933           
Flag Coverage Δ
android-unit-tests ∅ <ø> (∅)
flutter-unit-tests 35.67% <ø> (ø)
ios-unit-tests 89.69% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...s/amplify_core/lib/src/types/models/auth_rule.dart 0.00% <ø> (ø)

READ,
GET,
LIST,
SYNC,
Copy link
Contributor

Choose a reason for hiding this comment

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

Per my understanding these finer read operation controls work out of box for API plugin, are these finer controls supported in DataStore? If not, do we have a documentation calling this out - not to use these finer read control with DataStore?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These are not supported in Datastore especially for the local storage. The auth rules are only respected when it syncs with cloud. Adding these enums is to make the modelgen file compiled for those who uses these files only for API usage.

There is no document on this part but I will have a PR out later to call out that the finer read ops are not recommended for Datastore usage. If cx insists on using them, the sync and listen are required.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Update with the doc PR: aws-amplify/docs#5084

HuiSF
HuiSF previously approved these changes Feb 3, 2023
HuiSF
HuiSF previously approved these changes Feb 8, 2023
@HuiSF HuiSF changed the base branch from main-v0 to main May 3, 2023 23:25
@HuiSF HuiSF dismissed their stale review May 3, 2023 23:25

The base branch was changed.

@HuiSF HuiSF changed the base branch from main to main-v0 May 3, 2023 23:25
@HuiSF HuiSF changed the base branch from main-v0 to main May 3, 2023 23:33
@HuiSF HuiSF changed the title fix: add granular read ops enum feat(datastore): add granular model read operations May 3, 2023
@HuiSF HuiSF changed the title feat(datastore): add granular model read operations feat(core): add granular model read operations May 3, 2023
@HuiSF HuiSF merged commit 81b8728 into aws-amplify:main May 4, 2023
91 checks passed
dnys1 pushed a commit that referenced this pull request May 9, 2023
## 1.1.0

### Features
- Dart 3 support (must update SDK constraint to `^3.0.0-417.4.beta`)
- feat(core): add granular model read operations ([#2611](#2611))

### Fixes
- fix(notifications): configure call hangs on Flutter app hot restart ([#3013](#3013))
- fix(repo): AGP 8.0 compatibility ([#2942](#2942))
- fix: convert AuthUserAttributeKey in updateUserAttributes

Updated-Components: amplify_lints, Amplify Flutter, Amplify Dart, Amplify UI, DB Common, Secure Storage, AWS Common, Smithy, Worker Bee
dnys1 pushed a commit that referenced this pull request May 9, 2023
## 1.1.0

### Features
- Dart 3 support (must update SDK constraint to `^3.0.0-417.4.beta`)
- feat(core): add granular model read operations ([#2611](#2611))

### Fixes
- fix(notifications): configure call hangs on Flutter app hot restart ([#3013](#3013))
- fix(repo): AGP 8.0 compatibility ([#2942](#2942))
- fix: convert AuthUserAttributeKey in updateUserAttributes

Updated-Components: amplify_lints, Amplify Flutter, Amplify Dart, Amplify UI, DB Common, Secure Storage, AWS Common, Smithy, Worker Bee
dnys1 pushed a commit that referenced this pull request May 9, 2023
## 1.1.0

### Features
- Dart 3 support (must update SDK constraint to `^3.0.0-417.4.beta`)
- feat(core): add granular model read operations ([#2611](#2611))

### Fixes
- fix(notifications): configure call hangs on Flutter app hot restart ([#3013](#3013))
- fix(repo): AGP 8.0 compatibility ([#2942](#2942))
- fix: convert AuthUserAttributeKey in updateUserAttributes

Updated-Components: amplify_lints, Amplify Flutter, Amplify Dart, Amplify UI, DB Common, Secure Storage, AWS Common, Smithy, Worker Bee
dnys1 pushed a commit that referenced this pull request May 10, 2023
- Dart 3 support (must update SDK constraint to `^3.0.0-417.4.beta`)
- feat(core): add granular model read operations ([#2611](#2611))

- fix(notifications): configure call hangs on Flutter app hot restart ([#3013](#3013))
- fix(repo): AGP 8.0 compatibility ([#2942](#2942))
- fix: convert AuthUserAttributeKey in updateUserAttributes

Updated-Components: amplify_lints, Amplify Flutter, Amplify Dart, Amplify UI, DB Common, Secure Storage, AWS Common, Smithy, Worker Bee
dnys1 pushed a commit that referenced this pull request May 10, 2023
- Dart 3 support (must update SDK constraint to `^3.0.0-417.4.beta`)
- feat(core): add granular model read operations ([#2611](#2611))

- fix(notifications): configure call hangs on Flutter app hot restart ([#3013](#3013))
- fix(repo): AGP 8.0 compatibility ([#2942](#2942))
- fix: convert AuthUserAttributeKey in updateUserAttributes

Updated-Components: amplify_lints, Amplify Flutter, Amplify Dart, Amplify UI, DB Common, Secure Storage, AWS Common, Smithy, Worker Bee
dnys1 pushed a commit that referenced this pull request May 10, 2023
- Dart 3 support (must update SDK constraint to `^3.0.0-417.4.beta`)
- feat(core): add granular model read operations ([#2611](#2611))

- fix(notifications): configure call hangs on Flutter app hot restart ([#3013](#3013))
- fix(repo): AGP 8.0 compatibility ([#2942](#2942))
- fix: convert AuthUserAttributeKey in updateUserAttributes

Updated-Components: amplify_lints, Amplify Flutter, Amplify Dart, Amplify UI, DB Common, Secure Storage, AWS Common, Smithy, Worker Bee
dnys1 pushed a commit that referenced this pull request May 10, 2023
- Dart 3 support (must update SDK constraint to `^3.0.0-417.4.beta`)
- feat(core): add granular model read operations ([#2611](#2611))

- fix(notifications): configure call hangs on Flutter app hot restart ([#3013](#3013))
- fix(repo): AGP 8.0 compatibility ([#2942](#2942))
- fix: convert AuthUserAttributeKey in updateUserAttributes

Updated-Components: amplify_lints, Amplify Flutter, Amplify Dart, Amplify UI, DB Common, Secure Storage, AWS Common, Smithy, Worker Bee
dnys1 pushed a commit that referenced this pull request May 10, 2023
- Dart 3 support (must update SDK constraint to `^3.0.0-417.4.beta`)
- feat(core): add granular model read operations ([#2611](#2611))

- fix(notifications): configure call hangs on Flutter app hot restart ([#3013](#3013))
- fix(repo): AGP 8.0 compatibility ([#2942](#2942))
- fix: convert AuthUserAttributeKey in updateUserAttributes

Updated-Components: amplify_lints, Amplify Flutter, Amplify Dart, Amplify UI, DB Common, Secure Storage, AWS Common, Smithy, Worker Bee
dnys1 pushed a commit that referenced this pull request May 10, 2023
- Dart 3 support (must update Dart SDK constraint to `^3.0.0`)
- feat(core): add granular model read operations ([#2611](#2611))

- fix(notifications): configure call hangs on Flutter app hot restart ([#3013](#3013))
- fix(repo): AGP 8.0 compatibility ([#2942](#2942))
- fix: convert AuthUserAttributeKey in updateUserAttributes

Updated-Components: amplify_lints, Amplify Flutter, Amplify Dart, Amplify UI, DB Common, Secure Storage, AWS Common, Smithy, Worker Bee
dnys1 pushed a commit that referenced this pull request May 10, 2023
- Dart 3 support (must update Dart SDK constraint to `^3.0.0`)
- feat(core): add granular model read operations ([#2611](#2611))

- fix(notifications): configure call hangs on Flutter app hot restart ([#3013](#3013))
- fix(repo): AGP 8.0 compatibility ([#2942](#2942))
- fix: convert AuthUserAttributeKey in updateUserAttributes

Updated-Components: amplify_lints, Amplify Flutter, Amplify Dart, Amplify UI, DB Common, Secure Storage, AWS Common, Smithy, Worker Bee
dnys1 pushed a commit that referenced this pull request May 11, 2023
- Dart 3 support (must update Dart SDK constraint to `^3.0.0`)
- feat(core): add granular model read operations ([#2611](#2611))

- fix(notifications): configure call hangs on Flutter app hot restart ([#3013](#3013))
- fix(repo): AGP 8.0 compatibility ([#2942](#2942))
- fix: convert AuthUserAttributeKey in updateUserAttributes

Updated-Components: amplify_lints, Amplify Flutter, Amplify Dart, Amplify UI, DB Common, Secure Storage, AWS Common, Smithy, Worker Bee
Stivenmore pushed a commit to JunoLuK/amplify-flutter that referenced this pull request Jun 9, 2023
Stivenmore pushed a commit to JunoLuK/amplify-flutter that referenced this pull request Jun 9, 2023
- Dart 3 support (must update Dart SDK constraint to `^3.0.0`)
- feat(core): add granular model read operations ([aws-amplify#2611](aws-amplify#2611))

- fix(notifications): configure call hangs on Flutter app hot restart ([aws-amplify#3013](aws-amplify#3013))
- fix(repo): AGP 8.0 compatibility ([aws-amplify#2942](aws-amplify#2942))
- fix: convert AuthUserAttributeKey in updateUserAttributes

Updated-Components: amplify_lints, Amplify Flutter, Amplify Dart, Amplify UI, DB Common, Secure Storage, AWS Common, Smithy, Worker Bee
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.

There's no constant named 'GET' in ModelOperation constants
4 participants