Running aggregations with Apollo

I’ve written a app in Meteor and React over the past year and its working well, however the complexity is starting to spiral and with no state manager like Redux its hard optimise client performance. Thus I’m at the point where I said - Lets rewrite client using Redux - great.

However, since the app is data focused and I run a lot of MongoDB aggregations through meteor methods I’m rethinking what would be the best way to link these aggregation results in the app, (reactivity is not a concern)

Of course using redux and binging data led me strait to Apollo. I like the idea (only started investigating)

So in short I have two concerns:

  1. Can I bind graphQL data to my app given a mongo aggregation (any resources) ?
  2. Can I connect say, both a mongo and a SQL database and have users pick what their preferred query language is and construct queries / aggregation using that language?

Separation of concern! Redux is a local state management and handles how data flows through your client app. Apollo ships a GraphQL client which uses Redux to manage data client-side and a GaphQL server which basically is a single REST endpoint that acts as a data store middleware and understands the graph query language specified by Facebook.

To answer you concerns:

  1. Yes. It would work like this: Client -> GraphQL query -> Apollo -> resolver -> query with aggregation -> MongoDB
  2. I don’t understand your question. What are you building?
1 Like

Maybe resolver? (-:

And 2. Yes, you can use both.

1 Like