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

Show all comments

Showing thread 29 of 114

jeroenhd1 reply#
My problem with GraphQL: it doesn't support generics.

I'm fine with request batching/complexity overloads/all that craziness. Most GraphQL libraries have some kind of protection mechanism in there, or allow you to artificially split up the request and forward it to your application load balancer.
I'm also fine with a lack of API versioning, especially for internal services.
Hell, I'll even tolerate the lack of dictionaries/maps because you can replicate the same data interchange by putting the key in the object you're requesting most of the time.
What I really want is to do not have to write a custom pagination wrapper type every time I write an API. Let me write a Paginated that contains a list of T and some metadata, dammit! I don't want to dump BookPaginated/PagePaginated/AuthorPaginated into different schemas!
Another thing that bothers me is how types extending an interface need to have each and every field repeated. If I declare interface Car with wheels: Int! then I don't want to have to specify wheels: Int! again inside SportsCar. Any kind of inheritance creates giant schemas and adding new types to the super type means you have to re-insert the same parameter a million times.
Combined with a well-integrated ORM, GraphQL can have serious performance improvements over REST and similar so I definitely prefer it for big applications, but there are so many things that annoy me to no end.

csnweb1 reply#
I think you may be should give a code first GraphQL a try, you can pretty much everything you want that way. You can write high level functions for pagination or whatever that way and have a base object that you can extend for all Types implementing the interface. I really don’t know why schema first seems to be the default, it’s really unflexible.
andrewingram#
Strawberry (a GraphQL lib for Python) actually supports using generics to define types, it’s often used for supporting repetitive structures like pagination.