Closed ShreyasBhandari closed 1 year ago
We have published an RFC on our plan for improving TypeScript support in Amplify JS & would love to get your feedback & suggestions!
@ShreyasBhandari - if I'm reading your code snippet correctly, the following would update the original with the new fields without TypeScript errors:
const updatedRow: QuoteInfo = await DataStore.save(
QuoteInfo.copyOf(originalRow2, (original) => {
Object.assign(original, copyUpdatedRow);
})
);
If that doesn't work, let me know! Thank you!
@ShreyasBhandari - closing this ticket as we have not heard back from you. If the guidance I provided above does not resolve your issue, please let us know. Thanks!
Before opening, please confirm:
JavaScript Framework
React
Amplify APIs
Authentication, GraphQL API, DataStore, Storage
Amplify Categories
No response
Environment information
Describe the bug
I am looping over the keys in an object and trying to update every value associated with those keys using datastore. However, when trying to do this the object is assigned a type of never
Expected behavior
I expected it to have the proper type since it did not give any type errors in the if statement on line 552
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