Re:We Fell Out of Love with Next.js and Back in Love with Ru...
by Aeolos on Saturday May 03, 2025 @05:54PM
(#43882662)
GraphQL APIs can easily DOS your backend if you don't configure extra protections (which are neither bulletproof nor enabled by default), they suffer from N+1 inefficiencies by default unless you write a ton of extra code, and they require extra careful programming to apply security rules on every field which can get very complex very fast.
On the plus side, it does have offer communication advantages if you have entirely independent BE and FE teams, and it can help minimize network traffic for network-constrained scenarios such as mobile apps.
Personally, I have regretted using GraphQL every time.
Re:We Fell Out of Love with Next.js and Back in Love with Ru...
by demilicious on Saturday May 03, 2025 @06:46PM
(#43882992)
My biggest gripe is losing the entire layer of semantics that HTTP gives you. POST is the only verb and different error states are conveyed via error objects in the returned JSON.
Re:We Fell Out of Love with Next.js and Back in Love with Ru...
by Bombthecat on Sunday May 04, 2025 @01:35AM
(#43884743)
The biggest issue is security. More often then not, the API allows you to see more than you should.
Re:We Fell Out of Love with Next.js and Back in Love with Ru...
by princevegeta89 on Sunday May 04, 2025 @06:37PM
(#43890200)
This is probably true, and it can only be uncovered by rigorous testing. There is a bunch of layers of abstraction that won't be very obvious if you are using GraphQL as opposed to rolling your own REST API.
For the disadvantages, I cannot think of any. It is a bit slower than hand rolling your own REST API, but the difference is not severe enough to make you give up on it.