From the course: AWS and React: Creating Full-Stack Apps (2019)
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Testing DynamoDB CRUD with a React app - Amazon Web Services (AWS) Tutorial
From the course: AWS and React: Creating Full-Stack Apps (2019)
Testing DynamoDB CRUD with a React app
- [Instructor] So now let's flush out the rest of our API in the code. Above function App, I'm going to write two new functions, one for update and one for delete. So on line 12, I'm going to type function updateTodo and it's going to take a todo and a newDescription and in the curly braces, the first thing I'm going to do is set that new description on the todo. So on line 13, I'll type todo, open square bracket, single quote, description and set that equal to the newDescription. Then I want to make the call to update it on the server, so I'll type API.graphql, open parentheses graphqlOperation. Open parentheses mutations.updateTodo and this is going to take a todo item, so I have comma, open curly braces, input:todo and this should update the item on the server. Below that on line 17, I'm going to type function deleteTodo and that's just going to take a todo. We really only need the ID, so you could pass that…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
(Locked)
Adding AppSync GraphQL to a React app1m 22s
-
(Locked)
Adding DynamoDB data through a React app2m 10s
-
(Locked)
CRUD DynamoDB data with a React app3m 53s
-
(Locked)
Testing DynamoDB CRUD with a React app3m 13s
-
(Locked)
DynamoDB data CRUD in your React app27s
-
(Locked)
How to DynamoDB data CRUD in your React app3m 29s
-
(Locked)
-