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.

Adding AppSync GraphQL to a React app

Adding AppSync GraphQL to a React app

- [Instructor] Remember when I did the AWS push, when I pushed everything up to AWS with Amplify and it asked me if I wanted to generate code? Well, that's the code that I want to use in my app to make changes to the data, fetch the data, update data, delete data, whatever it is. So I need to import these mutations into the code, very similarly to the mutations we saw in AppSync when we looked in the queries section. To run those, I need to generate an API client, which is provided for me, so really not much work, but I do need to-do it, obviously, and then I can run the create to-do mutation as well as other mutations. but I want to start with the create to-do mutation. and I'm going to start by kind of revisiting that in AppSync. So back here in AppSync, I'm going to select mutation, and I'm going to add a new mutation, and it gives me the defined mutation, so this is doing the work for me. I'm going to click on create…

Contents