It looks like they will have to, but maybe unlike react they can keep the same subscription interface for those who want it, just built on top their new super robust graphql implementation.
I don’t think MDG will be able to suffer the same response as the blaze vs react fiasco when it comes to their subscription interface.
…now I don’t know that they r building this. @sashko hinted above. Care to elaborate @sashko lol? …but basically they were late to the party on the react thing, graphql is an opportunity for them to redeem themselves, while also fixing long time issues with LiveQuery.
Basically this is the opportunity to publish events prior to writes, rather than tail oplog. Graphql seems to be built specifically for that. So that’s why graphql is likely a lot more appealing than react ever was to them. Graphql provides a playground where they can focus on getting implementation perfect. Whereas before when it came to subscriptions they had to worry about interface and a lot of other things.
So as far as mongo subscriptions go, there is mongoose + graffiti By rising stack. But what’s missing and what’s also missing from graphql altogether is subscriptions. That part of the spec isn’t complete. I assume it will be complete any day now. But I also don’t think it needs to be complete for MDG to start implementing what’s under the hood there. Their are proposals for the interface and it can likely by adapted near the end of completion of implementation. So basically MDG can put DDP and the best of LiveQuery to use plus long time ideas to fix performance, eg observe writes and propagate those to subscriptions instead of oplog tailing, in order to do the subscription stuff graffiti does not do, and likely will never do, and honestly what’s the most complex part.
Graphql is all fine and dandy but without subscriptions its worthless. I really don’t understand why subscriptions weren’t a first class priority. Along with relay it feels like it was, but in fact those queries u specify in ur react components run once! It also seems ur gonna have to specify them again in subscription form, which seems stupid. We do that in meteor but the way relay works is it populates props of the precise component where its used rather than universally give the client the data–so u shouldn’t have to specify both a query and a subscription; I hope it works out that way in the end.
So anyway my overall point is that MDG has an opportunity to shine here. Be the first one to make a subscription implementation for a major database for graphql and that will be a big deal. Think about it–this intersection of the stack ties so much together, u basically will need to come to meteor. I do think they should abstract it out of meteor as discussed above so they can have a product appealing to a larger audience and therefore has potential for more longevity. But with the best implementation of it, ie the most coupled addons in Meteor, it will make the most sense to try it out in Meteor itself, especially in the early days.
If this wasn’t meteor, u need node, npm, express, mongo, react, relay, ddp, isobuild, etc to demonstrate this. Thats what I mean by “intersection of the stack.” It covers that middle ground where the client perfectly touches the server and is connected over the wire via ddp. There’s competitors to ddp such as that Json tokens library, so it’s not like at this point Json over a sockets library is that big of a deal. But collectively it’s a lot to put together. This gives meteor an opportunity to learn from its mistakes and apply all it’s knowledge about isomorphic apps nobody else has.
My hope is they get the marketing aspects right. That means building this irrespective of meteor so it becomes the defacto mongo graphql subscription LIBRARY. And maybe while they are it, the rethink db one. But more importantly a pluggable subscription transport library for NPM apps. So where meteor requires u to buy into a huge stack, they offer Meteor.publish/subscribe for easy use outside of meteor–and of course I’m referring to whatever the graphql interface ends up being.
As long as they continue with the proprietary approach that only works in meteor (or at least is mainly used there), more general packages for smaller portions of the stack will gain more popularity on NPM. That’s the NPM vision in general. I think MDG should entertain partaking in that vision. The question becomes: will people just use our package and not in fact adopt meteor? Will we be giving something out and not getting anything in return? I think the net results will be better. U will get more overall lock-in toward something they built. Just as graphql is seemingly gonna garner a lot of lock-in or as react already has, this library I’m proposing could as well. More lock-in than an opinionated full stack framework ever could in the post-rails npm world. With that lock-in they have the best possible hook to motivate people to come to meteor proper via value adds.
…maybe it’s pie in the sky that we could become THE GRAPHQL SUBSCRIPTION TRANSPORT LAYER, but it’s worth a shot. At the very least if would mean a hell of a lot more community contribution than meteor is used to. It’s time to branch out into the world. NPM dictates this building block vision.