-
Notifications
You must be signed in to change notification settings - Fork 117
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] Model cannot be synced to cloud due to index field is null #1461
Comments
The same issue follow up discussed in amplify-ios which possibly applicable here as well: |
This is no longer an issue with GraphQL Transformer v2 type SecondIndexModel @model {
id: ID! @primaryKey
parentID: ID @index(name: "parent-id-index")
} When If there is no requirement to fix for v1, please close accordingly, thanks! |
The testing env might have been setup wrongly. This issue is still reproducible with transformer v2 |
Amplify CLI opened an issue for looking for a solution aws-amplify/amplify-cli#9915 |
The Amplify CLI issue you linked has been fixed. Are you still observing the issue with the latest versions of Amplify Android and the CLI? |
@eeatonaws I can confirm it is still happening as of today (Apr-13-2022), at least on Android with the following versions: CLI: 8.0.1 |
@HuiSF The mentioned issue was closed but the problem is still happening on Android. Values are still being set to null and getting rejected by DynamoDB. I tried using AppSync and setting value to null and I can see the exact same error as I see on CloudWatch, which is:
However, I have noticed that the problem is only happening when CREATING a new object. P.S. This problem also applies to all GraphQL mutations done using Android as well as they use the same codegen models. |
The underlying issue has been fixed on Amplify CLI side. Please ensure upgrade to Amplify CLI version >=8.0.2, and re-deploy schema (regenerate resolvers). |
Before opening, please confirm:
Language and Async Model
Java, Kotlin
Amplify Categories
DataStore
Gradle script dependencies
Environment information
Please include any relevant guides or documentation you're referencing
No response
Describe the bug
When saving a model with below schema, if the index field is not assigned, model can only be saved into local DB, but failed syncing to DynamoDB. In addition, amplify-ios doesn't report the underlying GraphQL error on invoking
DataStore.save
API.Original issue please refer to aws-amplify/amplify-flutter#306 (comment)
Same issue in amplify-ios: aws-amplify/amplify-swift#1390
Reproduction steps (if applicable)
parentId
fieldCode Snippet
Log output
amplifyconfiguration.json
No response
GraphQL Schema
Additional information and screenshots
GraphQL request when saving the model
GraphQL response
amplify-android was silent about this error. (please refer pasted logs above)
After removing
parentId: null
fromvariables
listed in the GraphQL request, the model can be saved into DynamoDB.The text was updated successfully, but these errors were encountered: