From the course: Build a React Application Using AWS Amplify

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Add a GraphQL query to your React component

Add a GraphQL query to your React component - Amazon Web Services (AWS) Tutorial

From the course: Build a React Application Using AWS Amplify

Start my 1-month free trial

Add a GraphQL query to your React component

- [Instructor] With products and people in your database, you're ready to really get things into motion on the front end. I have the products component open and you should open up that same file. As a reminder, it's under sourcecomponentproducts.js. The first thing we're going to do is we're actually going to comment out the import of product data. We no longer want to use the information in the Jason file, So we're going to make sure we can't. Now, if you've got your development server running now, this is going to cause an error but don't worry about that. We're actually going to have to build up to where this whole thing works again. The next thing we want to do is we want to create a new constant and we're just going to call this List Products. In other words, we want to build out a query that contains the actual graph QL we're going to send across the API and ultimately into app sync and pull out some data and…

Contents