Meteor Apollo - Now with Apollo Server 2!


#1

Hello,

We recently published 0.5 version of cultofcoders:apollo, the newest and most solid release ever. Works with apollo-server-express@2 meaning we have all the coolest things Apollo team did in their Apollo Server 2 versions. (few of them: built-in Upload Support, built-in cors support)

Let me clarify something: Meteor & Apollo are a match made in heaven, we benefit of Meteor’s simplicity, user system, reactivity and at the same time benefit of the awesome GraphQL API with lots of goodies.

We have things like:

  • Meteor Accounts Built-Integration
  • Your client can be anywhere (even in React Native), no dependency on Meteor
  • You have live queries! Yes. You do.
  • You have built-in support with Grapher
  • You can scale your queries with RedisOplog. (Now this is what I’m talking about)
  • You can deploy it with mup in an auto-scaling, zero-downtime environment (zero devops skills required)

With Apollo, you can take your app offline, you can do serious caching on client making things a breeze, and coupled with a frontend framework like React, things are wonderful.

Did I mention that it’s very easy to set up too ?

Thank you, hope this becomes useful!

PS: I’m working on providing tutorials for Meteor & Apollo & React so stay tuned, great things await. I promise. :wink:


Apollo Server 2 is out! :rocket:
#2

that’s neat and definitily need to check out!

I wonder if mdg adapts this as their official meteor integration, because I find it alienating that mdg develops both but is unable to offer a sophisticated apollo integration into meteor…


#3

I do not know if they will regard it as official, but if they add it in the documentation, it’ll be enough, people need to see the options they have, there’s also the ddp-apollo package to take into consideration

However this is more than just an apollo integration, it does a lot of things simple.


#4

How would we use this with Data Sources and a MySQL database?


#5

Same way as you with do it with Apollo. Note that this package, because it’s Meteor has tight dependency on MongoDB :slight_smile: If you want a fresh non-mongo approach, start with a bare project, and copy the way server is initialised from this package, so I would not advise using this package directly, Apollo is already simple, look how I hooked it bare-bones in Meteor with SQL:


#6

I was referring to the new Data Sources, which is part of Apollo Server 2. I think MDG hasn’t provided a MySQL Data Source yet, only RESTDataSource. I don’t want to use the old ways of connecting MySQL with Apollo.


#7

@tab00 you have full control over apollo server configuration and yes you can use those, and it blends in with your context. Read this: https://github.com/cult-of-coders/apollo/blob/master/docs/settings.md


#8

Hi @diaconutheodor, I just upgraded to 0.5.1 and it broke my app :worried:. My client is react-native and the web socket link seems to drop after I log in. I am still investigating. If I revert to 0.4.2 and Apollo 1.4.0, everything works. I have logged am issue on GitHub. I noticed that the endpoint for subscriptions charged from “subscriptions” to “graphql”.


#9

You have to see migrations.md and upgrade apollo packages.


#10

I did upgrade the apollo packages. Where is migrations.md?


#11

Check project root for Migration file


#12

Ok I found it, and I did all that. I can run queries and subscriptions from playground, but not subscriptions from react-native. I have done some investigations and updated the issue on GitHub. Essentially, I deliberately bounce the websocket link when I get a new login token, but when I send the login token in the header, it never gets reconnected.


#13

@diaconutheodor, I found the issue. There was a bug where the MeteorApolloConfig was not being passed to the subscription config getter. I have opened a pull request.


#14

Thanks! Released 0.5.2


#15

You are awesome. Thank you.


#16

How about an example app showcasing it all?


#17

Nice! One question, does the support for Grapher and Redis-Oplog add any extra weight on the client? Or can it be turned off if you don’t need it?

Also, how does this fit in with SSR? I agree an example app would be great!


#18

@stig @sacha an extensive boilerplate is on the way, I have lots of things on my plate but we’re working on the documentation of it all.

Regarding Grapher, it’s tightly integrated, however no-one stops you in having your client written with create-react-app or anything and use Meteor’s API as Apollo, that’s the beauty of this, the client can be even in React Native.

SSR is also do-able, we may need to hook into account packages to store a cookie as authToken, and you can have free-ssr with React without having to think about it. (Built-in a single package)

The vision is to create a “framework” that works together with everything kind of like Vulcan JS.


#19

Yes, that’s what we do currently.

Sounds great! I’m definitely considering this package as an option for Vulcan itself by the way, let me know if you’d be interested in contributing :slight_smile:


#20

Sounds good @sacha I am interested in following the vision, if VulcanJS needs certain things implemented, create an issue I will seriously consider it. It can be very good for marketing purposes as well.