Lurker News
Graphql is great, but is totally over hyped. This is probably more of a rant or a frustrated dev outburst.

but beginner to mid level developers are lead down the path of USE GRAPHQL especially on youtube... and this is just unfair and wrong.
The good:
- It makes working with describing the data you want easy
- It can save you bandwidth. Get what you ask for and no more
- It makes documentation for data consumers easy
- It can make subscription easier for you to use
- Can let you federate API calls
The bad
- It is actually a pain to use, depending on the backend you are using you'll have to manage
two or more type systems if there are no code first generates in your language
- It doesn't support map/tables/dictionaries. This is actually huge. I get that there might be
some pattern where you don't want to allow this but for the majority of situations working with json api's you'll end up with a {[key: string] : T} somewhere
- No clear path for Api versioning you'll end up with MyQueryV1.01 MyQueryV1.02 MyQueryV1.03
Don't use Graphql unless you're managing a solution/problem set that facebook intended graphql for
Invest your time in a simpler solution then running to GraphQL first
thanks for reading my ted talk
please any senior dev's drop your wise words so that any new dev's can avoid tarpits

Comments (433) 114 threads

Earlier comments
phendrenad2#
I also refuse to use GraphQL (after seeing it fail utterly and spectacularly in a high-profile project that chose GraphQL because it was the "new shiny"). But I'm sure it has some niche that it works for. After all, people are still using it in 2022.
enahs-sf#
My main gripe with it is it’s an added level of indirection that makes debugging just a little more difficult.

Back in the good old days, you could open up the network tab, see the request made by the client and copy as curl to debug it.
Now with SSR and graphql, such a workflow is out the window.

maximilianburke#
One of the things I dislike about GraphQL is that though the standard doesn't really specify a format all the implementations are closely tied to JSON.

Between that and the (at the time, anyways) abysmal serialization performance of Juniper we ended up abandoning GraphQL.

endisneigh3 replies#
What exactly is the simpler solution that doesn’t result in your same cons mentioned?
JohnHaugeland1 reply#
Making a regular api
endisneigh2 replies#
A regular api poorly implemented will have all the same cons and none of the pros.
geysersam2 replies#
Just make a perfect api without any drawbacks.

Continue this thread — 2 replies

JohnHaugeland4 replies#
> A regular api poorly implemented will have all the same cons and none of the pros.

Okay, so don't make a poorly implemented one?
Also, no, it kind of won't. Let's look at what they are again
.
"It is actually a pain to use"
Not an API characteristic
.
"you'll have to manage two or more type systems if there are no code first generates in your language"
Not an API characteristic
.
"It doesn't support map/tables/dictionaries."
Not an API characteristic
.
"No clear path for Api versioning"
Not an API characteristic
.
Looks like it's actually zero for four

Continue this thread — 4 replies

hestefisk#
SQL statements wrapped in function calls.
thomassharoon1 reply#
There are patterns that can get you the same benefits without having to use GraphQL.

Even on a REST API, you can achieve the same pros
> - It makes working with describing the data you want easy > - It can save you bandwidth. Get what you ask for and no more
You can describe the fields you need (and I assume that is what reduces the bandwidth)
GET /users?fields=name,addresses.street,addresses.zip
> - It makes documentation for data consumers easy
I don't think so in practice. You can see Shopify's GraphQL documentation [1]. If anything it is more complex than their REST API docs
> - It can make subscription easier for you to use
Not too different from using something like SSE or even websockets and every decent web framework seems to have a decent implementation
> - Can let you federate API calls
So many ways to achieve this at the application layer (which is what GraphQL federation does with a Router). In the python world this could be separate WSGI apps or racks in ruby? And makes no difference if done at the load balancer level.
[1] https://shopify.dev/api/admin-graphql/2022-07/enums/localiza...

endisneigh#
There a lot of ways to do the same thing as GraphQL. The point is if it’s as easy.

Load more comments