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.

Adding AppSync GraphQL to a React app

Adding AppSync GraphQL to a React app - Amazon Web Services (AWS) Tutorial

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

Start my 1-month free trial

Adding AppSync GraphQL to a React app

- [Instructor] Now that we have our API all set up in AppSync to talk to our dynamo DB table, we want to focus on the code. If you remember, when we went through the amplify process, we had it generate some code for us. We're going to look at one of those files now, so it's under source, graph QL, and we want to look at the queries file, and here we have a couple of queries. We have get to do, and list to do, and those are one to one with what we saw defined in the schema. You can also do some things for filtering and sorting, but we're just going to focus on the basic queries, so let's open up our code, and set the groundwork in there. So I'm going to type open SRC, slash, App, dot, js. Now here in the editor we need to import a couple more things. So on line four I'm going to put a curly brace in front of Auth, and after it I'm also going to import the API, and the graph QL operation. We also want to import our…

Contents