-
Notifications
You must be signed in to change notification settings - Fork 2.1k
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Datastore update rejected for composite key with authorization restriction #11089
Comments
I'm experiencing a similar issue.
Up until @aws-amplify@5.0.15 when saving a |
@alex-breen There's another bug in the Amplify codegen package where using
Feel free to use any other string value for |
Apologies, I spoke too soon. This patch will be released later today. We'll post another update once it goes out. |
5.0.25 works! There is still a minor different which is causing minor issues in my client: Since |
@guy-a Awesome! The fix did go out yesterday in 5.0.25. The change to have models instantiated with Prior to that fix, you'd have had to account for the possibility that an "empty" field could be either await DataStore.query(Profile, p => p.alias.eq(null)); Prior to the fix, this would only match "empty" fields that were either explicitly set to Thanks for calling it out though! If something like that had been an unintended side effect of the fix in 5.0.25, we would have needed to jump on it! |
@alex-breen The library side of this is resolved. Per @iartemiev's comment, to see correct behavior, you'd also need to update your indexes to work around amplify-codegen/issues/561 until it is resolved. |
Before opening, please confirm:
JavaScript Framework
React
Amplify APIs
DataStore
Amplify Categories
auth, api
Environment information
Describe the bug
Under the following conditions, a DataStore update is rejected:
Rejected update can be seen in network logs, under the GraphQL mutation, showing the rejected is due to a field restriction / lack of authorization. Even though the restricted field is not updated, its value is sent in the variables of the update mutation.
Expected behavior
Datastore update (saves) the change.
Reproduction steps
Deploy model.
Run DataStore update (save) query via javascript.
Code Snippet
// Put your code below this line.
Model (owner field is restricted to read only; composite key comprised of 'userId' and 'owner')
Javascript code:
Log output
aws-exports.js
No response
Manual configuration
No response
Additional configuration
No response
Mobile Device
No response
Mobile Operating System
No response
Mobile Browser
No response
Mobile Browser Version
No response
Additional information and screenshots
No response
The text was updated successfully, but these errors were encountered: