You've now learned two methods for updating data after it's been changed:

  1. Refetch the related queries.
  2. Modify Apollo's cache.

Refetching can be a bit slower, but ensures that the data on the frontend remains in sync with the server. Modifying the cache can be faster, but risks the data getting out of sync if you're not careful.

Which one is right? The approach you take depends on three things:

  1. Who has access to this data?
  2. How frequently is it likely to change?
  3. How important is it for the frontend and server to stay in sync all the time?

Coming up next, we'll learn a strategy that can help mitigate the risk of updating the cache instead of refetching.