-
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
subscribeToMore unsubscribes after partial error #11784
Comments
It actually seems to be pretty trivial, it seems it's possible to pass apollo-client/src/core/ObservableQuery.ts Line 570 in 8bc7d4d
|
Hey @skolodyazhnyy 👋 You're right, seems like we should be able to forward those options along to I'm also wondering if it would make sense to default those values to the same as the query itself. For example, if you set I'll take this to our next team meeting as well to discuss this idea to make sure I'm not thinking of this the wrong way. We'll be releasing 3.10 this week so no guarantees on a timeline here, but we will likely try and look at this for a 3.10.x patch release. Thanks again for the report! |
Thanks @jerelmiller. I think inheriting values makes sense, subscription queries are normally follow same "logic" as their main query. If developer already wrote error handling logic for main query it will work for follow up updates. Another thing to keep in mind, is making sure errors can be handled in a convinient way. I think they probably should be available in the I'm not sure if And, since I have you here, it would have been nice to add |
Issue Description
When
subscribeToMore
query fails partially, client would unsubscribe and callonError
handler.When I say "fails partially", I mean top node resolves but some nested nodes return an error. Server returns both
data
with partial data anderrors
with an array of errors.Unfortunately
subscribeToMore
does not provideerrorPolicy
nor any other mechanism to handle partial response. It seems if any node in the response returns an error the whole subscription is considered to "fail".Link to Reproduction
Description is enough
Reproduction Steps
Here is an example message exchange between client and server,
Client subscribes to a
onChange
subscription, querying two fieldsok
andko
In response, field
ok
resolves to"hello"
, butko
resolver returns an error.I would like to handle partial response, and deal with error separately, but instead
updateQuery
never gets called and subscription completes.@apollo/client
version3.9.6
The text was updated successfully, but these errors were encountered: