Skip to content
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

Support errorPolicy in useSubscription hook and subscribeToMore function #11165

Open
jerelmiller opened this issue Aug 24, 2023 · 5 comments
Open

Comments

@jerelmiller
Copy link
Member

jerelmiller commented Aug 24, 2023

Subscriptions created via client.subscribe(...) adhere to the errorPolicy passed into its options (#11162). This however is missing currently in useSubscription and subscribeToMore even though they use the same primitive function to kick off the subscription.

To ensure feature parity, errorPolicy should be a supported option in both the useSubscription hook and the subscribeToMore function available on ObservableQuery.

Edit: support for errorPolicy in useSubscription is live with 3.11.

@jhalborg
Copy link

@jerelmiller - Is there still no way to set errorPolicy:'all' in the Apollo Client useSubscription hook? So no way to handle partial successes in subscriptions?

@jerelmiller
Copy link
Member Author

@jhalborg so sorry I missed your comment! I was on vacation the week you tagged me 😅.

#11928 addresses this issue for useSubscription and will release with 3.11.0 so its coming soon!

@jhalborg
Copy link

No worries 😄

Great news, thank you!

@jerelmiller
Copy link
Member Author

Support for errorPolicy in useSubscription is live with 3.11. Please upgrade to that version to get this functionality.

@qndrey
Copy link

qndrey commented Sep 17, 2024

Would you mind to update docs? https://www.apollographql.com/docs/react/data/subscriptions/

errorPolicy (optional) Since 3.11.0

it is confusing now, since I thought it was available in 3.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants