From the course: AWS and React: Creating Full-Stack Apps
Unlock the full course today
Join today to access over 24,600 courses taught by industry experts.
Reading DynamoDB data with a React app - Amazon Web Services (AWS) Tutorial
From the course: AWS and React: Creating Full-Stack Apps
Reading DynamoDB data with a React app
- [Instructor] We've done one query to list the todos. Now we're going to look at another query to get a single todo, that getTodo. This will be fetched based on the ID of the todo. So first I want to look at the code that was generated to see that the ID is the parameter. So here back in the queries.js, I have the listTodos that we just added and now we have the getTodo and it requires the ID be passed in. But otherwise it's pretty similar. If I wanted to get a single todo, I can use getTodo by ID or with the listTodos, I could supply things like filter and limit and those types of parameters. So let's do the getTodo and then we'll have both of our queries that were generated for us in the code. So looking at our App.js, I need to import the getTodos and I can do that on the same line as the listTodos. I put a comma after listTodos and then I also import the getTodo. Now I need to write a function. I'm going to base it off…
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 app6m 29s
-
(Locked)
Adding DynamoDB data through a React app3m 58s
-
(Locked)
Reading DynamoDB data with a React app2m 40s
-
(Locked)
Updating DynamoDB data with a React app3m 7s
-
(Locked)
Challenge: Deleting DynamoDB data in your React app36s
-
(Locked)
Solution: Deleting DynamoDB data in your React app3m 11s
-
(Locked)
-