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
svnpenn3 replies#
> It can save you bandwidth. Get what you ask for and no more

I don't, and never have believed this argument. I would bet that JSON with Gzip or Zstd is just as small, or close enough that it doesn't matter.

itsdrewmiller1 reply#
If you have any data sets with an open text field that you don't care about, or where you really only need to get the ID from a wide table, it will definitely save a ton of bandwidth. How often that really matters on the other hand...
horsawlarway#
And in this case usually you can easily opt to exclude the troublesome field with a param, or an endpoint that returns a minimum version of the entity.
locutous#
Nothing prevents you from compressing the smaller response of what you asked for.
speedgoose#
A graphql query is usually sent inside a JSON document and a graphql response is usually a JSON document sent over HTTP with compression. You do have to upload the query but you can select only the data you need, and you can also do that in a single query compared to a classic almost REST API. That’s the part that saves bandwidth, sometimes.
mattbillenstein#
IMHO, it's a better contract with frontend apps than REST, but you have to be mindful of the backend implementation and the shape of the GQL schema more or less matching your DB schema.
4dregress#
Being a good engineer (in any domain) means you have the experience to can pick the correct tools for the job and then explain why you have chosen those tools.

It all depends on what the end goal is.

Aeolun#
> No clear path for Api versioning you'll end up with MyQueryV1.01 MyQueryV1.02 MyQueryV1.03

Think very hard about your API. And absolutely do not ever introduce any query called V1 or V2.

Load more comments