Is it silly to use both GraphQL and Mongo API?

I would like to use GraphQL, but I also want to use watch() (How to use watch() on web SDK?), but if I’m going to set up the Mongo web API anyway, it seems a little silly to set up everything for GraphQL as well… am I missing something?

My personal opinion is that GraphQL comes into its own when your web app has to work with multiple data sources. If all of those data sources provide a GraphQL API then it can simplify your code to use GraphQL for everything. If MongoDB was my only data source then I’d use the Realm SDK.

Thanks for the reply! That makes sense. One thing that occurred to me is that Apollo client offers a lot more than just the GraphQL connection; if I understand correctly it would basically replace Redux, for example, whereas with the Realm SDK I’d be implementing my own client-side caching etc. Does that make sense?

Regardless of that though, my main question is if it’s necessary to use both in order to replicate the missing GraphQL subscription feature.

I think that your hybrid approach is the way to go if you want to use GraphQL and need a way to receive notifications. You may want to up-vote this feature request to add subscriptions to MongoDB’s GraphQL service https://feedback.mongodb.com/forums/923521-realm/suggestions/40640038-add-graphql-subscriptions

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.