Sample Apollo Meteor Setup

Hey ya’ll, I took @helfer 's last post and used it as a good learning experience for Apollo. This repo is a collection of
data integrations:

Currently does a REST api, Meteor Mongo, and MYSQL. I think it would be cool if this were featured as a go to example for the Apollo docs and if others contributed more data sources to it. Ideally, if we can just show one app have several connectors, it’d be pretty powerful

10 Likes

Dude that’s awesome! Going to check it out more in depth today!

Also I’m thinking we probably need an Apollo category on the forum.

3 Likes

Yeah man, gonna be contributing some other stuff as well!

1 Like

Created a category! Need more chars

1 Like

This is really cool, but is there a way to insert from a mutation resolver using the Mongo collections that ship with Meteor? IE, something like:

Mutation: {
    createTodo(root, { title }) {

      return Posts.insert({
         title,
       });
    }
  }

When I run that code, it silently fails. If you run it within a try-catch, the error is:

Meteor code must always run within a Fiber. Try wrapping callbacks that you pass to non-Meteor libraries with Meteor.bindEnvironment.

So of course, I tried wrapping it in Meteor.bindEnvironment, but I get the same error.

Any ideas?

3 Likes