Re:REST vs. GraphQL – A search for evidence on which is better
by TheCoelacanth on Tuesday December 15, 2020 @12:53PM
(#25432807)
In my experience, N+1 queries are roughly as easy to run into with naive GraphQL as with naive REST. When you are optimizing the queries, it's slightly easier to get rid of the N+1 behavior in GraphQL than in REST because you can see exactly what data the client is trying to get and can fetch data differently based on that instead of needing to come up with your own way for the API to describe what data to fetch.
[ Parent
| on HN ]
Re:REST vs. GraphQL – A search for evidence on which is better
by SkyPuncher on Tuesday December 15, 2020 @08:07PM
(#25437753)
> In my experience, N+1 queries are roughly as easy to run into with naive GraphQL as with naive REST.
We're currently dealing with this on a REST API right now. If you have highly relational data, you run N+1 risks regardless. I think people misplace blame on REST/GraphQL when they will have fundamental data issues either way.
We're exploring a few ways of solving it, but they honestly all resemble GraphQL.