Перейти к содержимому

Handling Errors with Apollo Client (React)

Dmytro Danylov

0:00 / 0:00

Handling Errors with Apollo Client (React)

14 862 просмотра · 5 лет назад
Dmytro Danylov
4 тыс. подписчиков
14 862 просмотра · 5 лет назад
In this video I talk about handling errors when running queries and mutations using Apollo Client in a React project. Table of contents: 00:00 Introducing the project that I use for examples 01:54 Handling errors in a GraphQL query 02:20 Handling a network error in a GraphQL query 05:14 Different kinds of errors reported by Apollo Client (graphqlErrors and networkError) 10:04 Handling GraphQL errors when running a query 13:36 The "errorPolicy" option 16:21 Reading the graphqlErrors array 19:51 Handling errors in GraphQL mutations 20:56 Unhandled runtime error 25:02 Validating form input on the server (Apollo Server's predefined error classes, UserInputError) 27:25 Apollo Server predefined errors: UserInputError 28:30 Parsing the graphqlErrors array and rendering the validation errors 37:36 Processing all query and mutation errors with Apollo Link Error Code: https://github.com/d-dmytro/youtube-h... Apollo Server: Error Handling https://www.apollographql.com/docs/ap... Error Link https://www.apollographql.com/docs/re... 👨‍💻 My Udemy Course: Using TypeScript with React https://www.udemy.com/course/react-wi...