1. 5
    Handle GraphQL query error states using Apollo
    2m 56s

Handle GraphQL query error states using Apollo

Share this video with your friends

Send Tweet

Similar to loading states, Apollo also gives us a simple error object from its useQuery hook. We can use this to handle what to display to the user if there's an error. There's a catch, however: your server might still send you partial data when there's an error, and Apollo blanks this data out by default, so that you don't forget to handle that state. We'll see how to handle this use-case by specifying an errorPolicy.