React
Boost Your React Apps with Apollo: Fetching & Updating Data

Exercise: Delete Habits with Refetching

Mute
Current Time 0:00
/
Duration Time 0:00
Loaded: 0%
Progress: 0%
Stream TypeLIVE
Remaining Time -0:00
 
PRO

Let's get you some practice with adding a mutation feature.

Here's what you'll need to do:

  1. Use GraphQL Playground to construct the deleteHabit mutation with the correct variables.
  2. Add the mutation and the useMutation hook to Habit.js.
  3. Add a button next to each habit item to call the mutation.
  4. Don't forget about the error and loading states!

I'll show you what I came up with in the next video.

 

I finished! On to the next chapter