Skip to content
This repository has been archived by the owner on Sep 2, 2022. It is now read-only.

Live Query support #1205

Closed
joshhopkins opened this issue Nov 8, 2017 · 5 comments
Closed

Live Query support #1205

joshhopkins opened this issue Nov 8, 2017 · 5 comments

Comments

@joshhopkins
Copy link

joshhopkins commented Nov 8, 2017

What feature are you missing?

While not yet part of GraphQL specification, this is a tentative request for live query support: including defer, live and stream directives.

Reference:

How could this feature look like in detail? Tradeoffs?

  feed {
    stories {
      author { name }
      message
      likeCount @live
    }
  }
}
@kbrandwijk
Copy link
Contributor

To be honest, Apollo has been very, very silent about it for over a year (that's how old the roadmap is). Same goes for the GraphQL spec. Relay Modern supports 'live queries' by setting a poll interval, and just executing the same query every time, which in all honesty, has nothing to do with the proposed workings of live queries (getting deltas pushed).

So with no movement on the client side, the spec side, and the server side, I'm afraid this isn't going anywhere any time soon.

@joshhopkins
Copy link
Author

joshhopkins commented Nov 8, 2017

To be honest, Apollo has been very, very silent about it for over a year (that's how old the roadmap is). Same goes for the GraphQL spec.

It's not total radio silence: “Support for these is now possible with Apollo Link, which can accept multiple results from an…” — @jbaxleyiii https://dev-blog.apollodata.com/apollo-client-2-0-5c8d0affcec7

Apparently Apollo Link uses observables to support live queries.

So with no movement on the client side, the spec side, and the server side, I'm afraid this isn't going anywhere any time soon.

If nothing else, here's a place for the Graphcool community to +1

@jasonkuhrt
Copy link
Contributor

Talks:

@mattferrin
Copy link

I think Prisma's database oriented conventions empower it to implement live queries. Apollo and Relay don't have structured database rules. All queries and subscriptions in Prisma have a where input. Basically, if you put the where and what (the what is the queried fields) of the query into a subscription, you could recompute the query everytime the subscription fires. Get fancier on the client, you could patch using the subscription instead of refetching. My point, it could be built directly atop subscriptions because Prisma's so structured.

My biggest issue with Prisma right now is that subscriptions seem to receive in other windows and other tabs. I want them to receive in the same client/tab that caused the mutation, so I can jerry rig my live queries client-side in the interim.

@robertherber
Copy link

This would help a lot!

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

No branches or pull requests

8 participants