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

Exercise: Use Error and Loading in the UI

PRO

Apollo provides us error and loading states that can really improve user experience (UX).

Your assignment here is to take advantage of both of those:

  1. Make the error handling a little nicer by displaying the error to the user.
  2. Prevent the user from submitting the form multiple times using loading. You could also change the appearance of the button based on whether the mutation was still loading.

Note: I first showed you the error and loading states in the First Steps tutorial of this course. Check out Your First Query and Test the Query in the Browser if you need a refresher!

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

 

I finished! On to the next chapter