-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Breaking change] Unify error handling #352
Conversation
@stubailo should be ready for review |
@@ -4,6 +4,7 @@ Expect active development and potentially significant breaking changes in the `0 | |||
|
|||
### vNEXT | |||
- Added support for query composition through fragments [Issue #338](https://github.com/apollostack/apollo-client/issues/338) and [PR #343](https://github.com/apollostack/apollo-client/pull/343) | |||
- Unified error handling for GraphQL errors and network errors. Both now result in rejected promises and passed as errors on observables through a new `ApolloError` type. This is a significant departure from the previous method of error handling which passed GraphQL errors in resolvers and `next` methods on subscriptions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is a breaking change, can we mention this in the changelog? Along with issue/PR numbers
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed, although we don't seem to have an associated issue so I just linked this PR which describes what the issue is as well.
This looks great to me. Given that this is a big breaking change, I think we should prepare some other stuff to merge at the same time. Can you submit a PR to the docs for this as well? @jbaxleyiii we probably have to do some stuff in @kamilkisiela do you think we need to do anything new to support this in |
@stubailo No change needed 👍 So it won't be a breaking change in |
@stubailo Sure, I'll write up some docs that describe how |
@stubailo Added the above PR to apollostack/docs. I guess we can merge this + docs once we've introduced other breaking changes as well. |
@Poincare thanks for updating docs for angular2! :) |
Unifying the error handling so that both GraphQL errors and network errors will be presented in the form of rejected promises or errors on observers. This makes it easier to deal with both types of errors and not have to always introduce two different types of error handling code.
TODO: