Apollo integration and 1.5 release - will it happen anytime soon?

Might be worth a post or something similar for how people can use them together today. Would that be helpful to anyone on this thread?

13 Likes

I am a little bit alianated by the fact, that neither the meteor-guide mentions apollo, nor that http://dev.apollodata.com/ mentions meteor.

I would love to see an “official” way as soon as possible.

8 Likes

We have a list of Meteor examples in the Apollo docs here: http://dev.apollodata.com/core/#Meteor-Examples

Currently a blog post about how we (and others) are using Meteor and Apollo would likely fall short of an “official” or supported integration, but hopefully it would be helpful in the interim.

3 Likes

FWIW we have some apps running on Galaxy too, using Blaze with Apollo with this package by @jamiter: https://github.com/Swydo/blaze-apollo. And we’ve shipped Meteor with React and Apollo. It already works; what I’d like to see in the release that incorporates a tighter Apollo integration is less boilerplate and things like automatic accounts support and subscriptions.

@sashko it also might help to describe what Apollo and Meteor working together look like today, and how that differs from an imagined Meteor release with Apollo support.

2 Likes

Going to work on a blog post soon! Also I agree the documentation could be easier to find for people who are interested.

7 Likes

I have Apollo running in my Meteor app. It works great and is very easy to add to Meteor, i.e. not a lot of lines of code are required. All that’s needed at this point is docs such as the blog post @sashko will be providing. Some items that may be helpful to include:

  • Setting up the server side (complete code sample would be very helpful)
  • Dealing with CORS issues (I posted some sample code for this here)
  • Pub-Sub sample code of course, for reactive data
3 Likes

Can Apollo do fully reactive data today, like pubsub + Tracker? I saw some talks by FB about adding it in GraphQL but I don’t know anyone who’s using those features. and am not sure what the subscriptions in Apollo actually use under the hood.

Apollo and GraphQL currently do not support livequery functionality like Meteor does, and probably won’t for a while until there is more of a consensus of how those should work in the GraphQL standard.

@sashko, have you taken a look at redis-oplog? I am sure you are watching the forum, this package solidly extends the current publish functions to incorporate redis as a pub/sub framework. Is that a route you can consider for GraphQL? We are using it in production and it’s working great (in fact, as more people move to it, the barrier to switching to GQL will be higher as we are getting used to scalable reactivity)

At the moment, reactivity in the nodejs world has a big void now that rethinkdb is gone (other than Meteor + redis-oplog). This could be a solid business opportunity for Apollo!

1 Like

So how does it interface with REST APIs? Does it do polling? For some reason I was under the impression that Apollo eliminated the need to repeatedly/manually call something like HTTP.get.

Apollo currently has publish and subscribe capability for reactive data. Here’s a link to a Stackoverflow page where I posted sample Apollo pubsub code in response to a question:

We’re hoping to incorporate some reactive stuff in GraphQL too! If the Meteor stuff works for you right now, there’s simply no reason at all to move to GraphQL :]

We have a GraphQL subscriptions package that works off of redis, so perhaps it will be easy to hook the redis oplog stuff into there but I haven’t tried.

Yes, Apollo handles automatically calling static queries when your component loads, and includes options for polling. There’s no server-side push except for GraphQL subscriptions, which run off of a message bus like Redis (or the oplog if you hook it up)

2 Likes

I’m going to be tackling Meteor + Apollo soon, so a blog post would be really helpful!

2 Likes

Not to derail the thread, but I think rumors of Rethink’s death are greatly exaggerated. I wouldn’t be surprised if in 5 years it becomes the Postgres version of open source NoSQL.

I’m tackling it now. There are some good posts out there. What concerns you and maybe I can provide some links…?

1 Like

Any links would be useful, especially regarding Meteor. I’ve found a few posts and stuff, but not many that give you tons of insight into the best way to set things up etc.

Off-topic though, do you know of a good way to integrate RethinkDB into Meteor? I still love Rethink, so it’d be great to use that in some way!

1 Like

@ramez started working for this (RethinkDB for Meteor), but I don’t know if he has finished the integration.

My goal was 2 things:

  1. Migrate accounts which is mongo-reliant to rethinkdb
  2. Use Mongo-style query server-side to make queries to rethinkdb for backwards-compatibility (and because I dislike ReQL, but that’s personal)

Both were very lofty goals and we seemed to going in circles everytime a new unsupported mongo query pops up. Not easy going from string style query to functional queries. I’d be happy to share our code base but it’s far from production-ready and I don’t want people to be mislead. I would rather stake our future on redis-oplog than rethinkdb, as redis-oplog uses existing structure of mongo reliance and adds a layer on top, while using rethinkdb the way we wanted to was a monumental undertaking require forks of core packages.

We based it on https://github.com/Slava/meteor-rethinkdb which works well btw – but depends on customization of a library for client-side queries that will likely not be updated. So you can use that and be on your way (we found no bugs in it, it may just not have all the things you need, try it)

Can we have off topic conversations in a different topic?

2 Likes

I’ve also noticed a void of documentation in specifically integrating Apollo with Meteor. Part of the confusion is probably attributed to the plethora of solutions/documentation available now?

https://github.com/kamilkisiela?tab=repositories, https://github.com/chentsulin/awesome-graphql, http://dev.apollodata.com/

However, I was pleasently surprised on how seamless it was to integrate Apollo into an Angular2 Meteor app. I’m sure the same thing can be said for React, Blaze or other clients?

Here’s how I did it:

  1. Downloaded the “GraphQL server” apollostack/frontpage-server from https://github.com/apollostack/frontpage-server and launched it.

  2. Copied the front end code from https://github.com/apollostack/frontpage-angular2-app "Angular2 App"
    I couldn’t get this Angular2 app working. There’s some Webpack/Angular2 error breaking many things??
    “Module build failed: TypeError: Cannot read property ‘exclude’ of undefined”

  3. And inserted the code into the Angular2 Meteor Socially app I downloaded from https://angular-meteor.com/tutorials/socially/angular2/angular-material-and-custom-angular-auth-forms

  4. Launch the Angular2 Meteor app and it worked!

Here’s a copy of it: https://github.com/cesargalindo/socially-apollo-step18

To see the changes I made diff the package.json file and the client folder to the original Socially Step 18 tutorial.

2 Likes

Creating an Apollo integration for meteor is a strategic action for meteor survival but they are postponing it and the result is increasing ‘To be or not to be’ posts in forums.

2 Likes