aws-amplify / docs

AWS Amplify Framework Documentation
https://docs.amplify.aws
Apache License 2.0
486 stars 1.06k forks source link

Lack of complex examples in the documentation #7966

Open sundnet opened 1 month ago

sundnet commented 1 month ago

Describe the content issue: I tried to describe CartItem data model and update the CartItem but it was hard to get an example to update properties where there is hash and sort key. Most of the example or search or chatgpt solutions only provide gen1 examples . The below code was generated by chat gpt, but i could not correct it as there is lack of complex examples everywhere. Manytimes, i had to trial and error or rely on chatgpt to provide the code but sometimes even that fails. Please add tons of example snippets for variety of scenarios and it wont cost AWS anything ,but it is very hepful for coders who are new to gen2 amplify .

await client.models.CartItem.update({ userId: userId, lineItemId: lineItemId, // Composite key { quantity: quantity, total: quantity * cartItems.find((item) => item.id.lineItemId === lineItemId)?.price ?? 0 }, });

URL page where content issue is:

esauerbo commented 1 month ago

Hey @sundnet sorry you're having issues getting this working. Can you provide the link to the tutorial you're working with?