cult-of-coders / apollo-live-server

A set of tools to enable reactivity in Apollo alongside Meteor
MIT License
13 stars 5 forks source link

Hybrid Reactive Data Graphs #5

Open theodorDiaconu opened 6 years ago

theodorDiaconu commented 6 years ago

If i'm requesting:

query {
   user {
       billingProfile { status }
   }
}

and a subscription with the same pattern.

The subscription needs to be intelligent enough to detect that it uses links.

apollo-live-server is kinda constructed around Meteor either way. But with this approach we're gonna introduce a dependency on Grapher. Which I think is ok, better to be in one ecosystem than deal with 4 diff packages.

So the logic would be that we don't have reactivity for underlying data, we have only for the parent. This means that added() events should trigger a graph run for that item. And changed() needs to detect whether a link storage field has changed that is related to a certain sub-collection so we can requery it.

This need to happen automatically without any other configuration such as hooking into resolve() and applying it based on the changed events.