Giter Club home page Giter Club logo

Comments (3)

skolodyazhnyy avatar skolodyazhnyy commented on June 22, 2024

It actually seems to be pretty trivial, it seems it's possible to pass errorPolicy (and maybe fetchPolicy too) here

.startGraphQLSubscription({

from apollo-client.

jerelmiller avatar jerelmiller commented on June 22, 2024

Hey @skolodyazhnyy 👋

You're right, seems like we should be able to forward those options along to startGraphQLSubscription. I think this is likely a good change.

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 errorPolicy to all in your query, perhaps subscribeToMore should also default to this value. What are your thoughts on that?

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!

from apollo-client.

skolodyazhnyy avatar skolodyazhnyy commented on June 22, 2024

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 updateQuery as you may want to modify how update is merged with original query depending on what errors you are getting.

I'm not sure if onError should be called, I think it will be backwards incompatible change as current call to onError means "subscription is over".

And, since I have you here, it would have been nice to add onComplete option to subscribeToMore so I can get notified when subscription has completed successfully :)

from apollo-client.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.