Closed vfonic closed 5 years ago
Nice catch! We decided to discuss error handling in the third part of the tutorial, so for now your code should just do nothing. I'll update the article text shortly, and let's discuss a way of handling errors as soon as the third part arrives
@DmitryTsepelev thanks! I'll be on the lookout for the third part in the series!
Since there's no real actionable tasks here, apart from making third part in the series, I'll close this issue.
I noticed that, in the second part of the tutorial (https://evilmartians.com/chronicles/graphql-on-rails-2-updating-the-data) when logging in with non-existing user (email), the guide says the app will return errors, but it doesn't. It just returns the empty data: https://github.com/evilmartians/chronicles-gql-martian-library/blob/master/app/graphql/mutations/sign_in_mutation.rb#L9-L10
The above is a screenshot for the guide. Here's my Google Chrome screenshot:
How do you usually deal with these cases in your applications? Do you return an error to the user and then deal with it in rejected promise
.catch
? Or do you do something like: