Re:Microservices and the layers to watch for when architecti...
by ngrilly on Monday October 25, 2021 @09:50AM
(#28987759)
If the underlying data store is SQL capable, then dataloaders are just a hack trying to do what the SQL engine already does in much more efficient way. Much better to map the GraphQL query to proper SQL query avoiding the round trips.
[ Parent
| on HN ]
Re:Microservices and the layers to watch for when architecti...
by intellisense on Monday October 25, 2021 @10:06AM
(#28987957)
Yes, with SQL engine you can fetch a parent row with all its children in one go. However, sometimes the client does not need child rows at all and in this case there will overfetching from database and maybe it is fine when query is fast.
My main question was why implement GraphQL BFF layer on top of REST layer. How is this efficient, unless you have legacy REST service that you want expose as GraphQL service. If I am writing a service from scratch why would I create a REST service and then wrap it with GraphQL service?