4 ms·
It's worked out great for us. We use it as a flexible way to get exactly what is needed in a single request that ends up pulling data from a mongo database. It
by peterohler 5y ago
It's worked out great for us. We use it as a flexible way to get exactly what is needed in a single request that ends up pulling data from a mongo database. It has not added any extra complexity. On the contrary it has simplified out backend and front end apps. We use go and https://github.com/UHN/ggql https://github.com/UHN/ggql.
- brundolf 5y agoI've been told one of the main reasons to use it is when you have lots of granular endpoints or databases that you want to stitch together for consumption; do you benefit from that with a single Mongo database? On the other hand, Mongo data already has a very similar structure to what GraphQL exposes, so it's a probably very straightforward to plug in I guess my question is: what benefit is it really giving you if it's just forwarding requests to your DB? Is it just the fact that your payloads on the wire can be made smaller sometimes?
- peterohler 5y agoA mongo database can have multiple collection or tables. Data from multiple tables can be joined together and then just what the user asks for is returned. We also include fields that calculate values based on data from the database. The caller need not be aware of the layout or structure of the data in the database. GraphQL queries allow for just the requested data to be returned and not a complete record from a database.
- brundolf 5y agoFair enough, that makes sense. It's been a while since I used Mongo and I used an ORM at the time so I forgot about how much joining can be required.