3 ms·
Having written https://glennengstrand.info/software/architecture/microservice/graphql https://glennengstrand.info/software/architecture/microservi... which is a
by gengstrand 6y ago
Having written https://glennengstrand.info/software/architecture/microservice/graphql https://glennengstrand.info/software/architecture/microservi... which is a blog entitled "GraphQL vs REST" I must admit that I was initially on guard with this blog. In then end, they did compare and contrast GraphQL with REST. I don't wish to go over this article point-by-point but their main arguments against REST seems to me to be this...
1. too many endpoints
2. too much data retrieval
3. too much coupling between clients and servers
The blog does not discuss when to choose REST over GraphQL since that would be in conflict of interest with those who hold Hasura equity.
Technically, GraphQL does decrease the amount of endpoints to one but at the cost of increasing client-side complexity because now client devs have to write what is essentially a query. To do so, they have to understand the backend schema. I would argue that this is not the greatest in terms of clear separation of concerns. I would also argue that this means that there would be even more coupling between client and server.
I won't cover the n+1 point since others here have already done so.