Code Monkey home page Code Monkey logo

Comments (8)

stubailo avatar stubailo commented on June 15, 2024 2

Currently reactivity is not on the short-term roadmap. We're trying to make the data loading experience for static data really good before jumping into reactivity. It turns out that reactivity and data streaming is a really easy crutch to lean on to fix data consistency problems, so we want to build something that works really well without it. It turns out most data sources people want to access at first aren't reactive anyway.

Currently, there are a few ways to get reactive features:

  1. pollInterval on watchQuery on Apollo Client will let you poll the server periodically: http://docs.apollostack.com/apollo-client/core.html#watchQuery
  2. You can manually call refetch on the query when you need new data
  3. After we add a couple new features to apollo client, you'll be able to manually stream websocket events into the store: apollographql/apollo-client#180
  4. You can use Meteor subscriptions for the reactive parts of your app, and use Apollo for the static parts

from apollo.

stubailo avatar stubailo commented on June 15, 2024 2

Yeah if the realtime features of Meteor pub sub work well for you there's almost nothing out there that will give you the same feature set right now. We're slowly trying to move towards that for GraphQL but it's not going to be there for a while.

from apollo.

hellogerard avatar hellogerard commented on June 15, 2024 1

Great stuff! I just read https://medium.com/apollo-stack/graphql-subscriptions-in-apollo-client-9a2457f015fb#.k80opif19

Just so I know I'm on the right track, couple questions:

  1. Does that article implement #3 on the list above?
  2. Seems like you've almost got full reactivity working without the invalidation server. I'm confused, what was the invalidation server for, in that case? If it's still necessary, what is it necessary for?

from apollo.

sashko avatar sashko commented on June 15, 2024 1

@joncursi I believe Sashko you're looking for is @stubailo ;)

from apollo.

s-devaney avatar s-devaney commented on June 15, 2024

Also - I thought that GraphQL didn't play well with polling for changes? How is this checking for GraphQL changes?

from apollo.

stubailo avatar stubailo commented on June 15, 2024

GraphQL subscriptions are pretty different - they don't do any change detection of diffing of data. When an event arrives, you just get the whole new result.

The invalidations and live queries would be something for the future, and the focus would be to get fine-grained updates, which subscriptions don't give you at all.

GraphQL subscriptions are definitely a great replacement for (3).

I thought that GraphQL didn't play well with polling for changes?

What do you mean?

from apollo.

joncursi avatar joncursi commented on June 15, 2024

@sashko is any of this reactivity possible in a Meteor + Apollo server today, or is the "recommended" solution for Meteor users mentioned here to use Meteor pubsub for live data and Apollo for static?

I just tried out Apollo subscriptions and wasn't thrilled with all of the setup and extra code that needed to be written in comparison to Meteor's pub/sub magic. Meteor spoiled me! 💃 (Plus the overhead of having to manage another external service like Redis... oy!)

from apollo.

joncursi avatar joncursi commented on June 15, 2024

Got it, thank you!

from apollo.

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.