Open elilambnz opened 3 years ago
Is there any solution ?
@fistofzen I haven't used the DataStore API for 7 months, if you're still having this issue on the latest version then only the workaround in the original issue will prevent this error. One thing to note, if you use the GraphQL API to query data instead, this will not retrieve any offline data.
Before opening, please confirm:
JavaScript Framework
React
Amplify APIs
DataStore
Amplify Categories
Not applicable
Environment information
Describe the bug
Querying a link model (i.e. the
PostEditor
model, given a modelPost
and a modelUser
with a many-to-many relationship) returns all records, including deleted records. If some items have been deleted and a query is performed:const data = await DataStore.query(PostEditor)
When DataStore tries to synthesise the data into models locally, it throws an error in the following format:
Unhandled Rejection (Error): Field <field> is required
One workaround for this situation is to manually query the link table using the API package instead:
Expected behavior
Instead of trying to synthesise data locally for deleted items, DataStore should first filter out the deleted records.
Reproduction steps
Code Snippet
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