Grapher or Grapher + Apollo?

I’m about to work on a new project for educational purposes and plan to learn Grapher along the way. I’m a bit confused on if I should include Apollo or not.

" ** Blends in with Apollo GraphQL making it highly performant*"

I saw that comment on the Grapher page, and comments like that make me wonder if this means it requires Apollo to become more performant?

I don’t necessarily need Apollo, but if it would lead to performance increases, I could integrate it. Wondering what the recommendation would be in this case?

You don’t need Apollo to use Grapher.

Grapher abstracts a GraphQL-like interface onto your existing Mongo collections within Meteor.

It’s main value is to bring relational lookups to Meteor Mongo. It simplifies your ability to define relationships between collections, and lets you easily construct nested queries to retrieve data across collections. Also, you don’t need to define a complete schema, only the fields relevant to defining relationships across collections.

It’s not GraphQL, but GraphQL-like at this point. It’s only used to optimize how you read and retrieve data. Writes are still as the normal Meteor/Mongo syntax.

The point at which you would probably want to integrate Apollo is when you need true GraphQL capabilities, such as working with datasets across different database engines and APIs, etc. That’s where mutations and schema definitions come into play, and Apollo is needed.

At minimum, Grapher gets you thinking in graphs in Meteor/Mongo and helps you construct complex queries a lot user, which also happen to be much more performant.

One point where I probably differ from the documentation is that I didn’t define static queries in the backend, and then clone them. I preferred to construct the query on-demand from the client, and then leverage the default exposures, and use firewalls and exposure rules to restrict data access.

It was a habit I picked up using this package: https://github.com/Herteby/grapher-vue and just found it a lot more intuitive to use on a component level, than statically defining the queries and then cloning them for use and overrides.

Then again, that’s what is nice about Grapher. It lets you choose your preferred style of calling queries.

Hope this helps.

3 Likes