From the course: AWS and React: Creating Full-Stack Apps

Unlock the full course today

Join today to access over 24,700 courses taught by industry experts.

Adding DynamoDB data through a React app

Adding DynamoDB data through a React app

- [Instructor] When Amplify generated code for us, it not only generated code to store data on the server, but also to run queries to fetch data. Fetch, boy. (whistles) Fetch. So we're going to fetch some data from the server. Now the only data we have is the data that we created. We're going to import the query that was generated for us and we're going to execute the list to-do queries. This is going to fetch all of the to-dos. Now of course this could be a little bit dangerous, so in reality you probably want to set a filter and look at some of the other options for fetching to-dos. As we saw before, it's also storing the owner, so we could pass that up and just get the to-dos for a specific user. But we're going to look at the general concept of doing a fetch of to-dos. Previously we looked at the mutations. Now I want to look at the source code generated for the queries. So in here I see that there is a get to-do…

Contents