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
ant1oz1 reply#
I totally agree, the list of frontend pro is super cool, especially the subscribe real time API, but on the backend, it is a pure nightmare, either using very cutting edge third parties, the authorization is a super big pain in the butt to implement. Cool you got a graph, now you need to make sure only user a can edit row b, there is the shortest path, but the data storage is still centralised.

And I doubt there will ever be any PWA POSSIBLE with graphql, so no offline usage, no local storage , nothing cool toward the web6 decentralised stack.

Eric_WVGG1 reply#
The syntax of GraphQL drives me utterly mad.

I feel like there’s two approaches that one could take to approach queries: a series of programming commands (the way most ORMs work), or an attempt at “plain language” (SQL and GraphQL).
Both approaches are fine, but if one wanted to take the latter approach… why not just use the syntax of SQL? It’s better in every conceivable way that GraphQL, equally legible but much more powerful.
GraphQL is idiot baby talk, I’m baffled by why we have to waste time dumbing down expressions for no clear payoff.

valenterry#
Yes and no.

SQL also sucks, since you have to SELECT before defining FROM. Which means, code completion isn't there for SELECT. At least with graphql you get full code completion all the time. I agree though that it lacks in other areas. Choice between pest and colera.

criley2#
GraphQL has advantages that make it great in certain situations but it can be very difficult to wrangle it at large scale and you basically need to hire Facebook GraphQL engineers once you get to a certain size.

If you are using Typescript on backend and frontend (react/reactnative ok, native ios/android app no) then checkout tRPC. https://trpc.io/ tRPC is basically: you just call your backend functions on your frontend, and TRPC handles the API that makes it work. It shares types and when you define a type for your backend, and call that function, you get the type on your frontend.
Incredible for small apps/teams, but has it's limitations (especially before the most recent version) and probably not the solution for a big honkin app.
I've been playing with create-t3-app and it's pretty nice, great way to launch a basic typescript/trpc/nextjs/prisma app. https://github.com/t3-oss/create-t3-app
I use GraphQL at work and it's fine, it's just a lot of code and codegen and work for a small team, we'd be faster on tRPC but tRPC didn't even exist when this codebase chose graphQL lol

bryanrasmussen#
In the systems where I designed both front and backend and the API I did not need graphQl, but in many of the large companies I have come in to where things have been developed by many people over a significant length of time GraphQL really improved the frontend performance and time to release new functionality once it was introduced.

Perhaps it would have been the case if they just cleaned up and released a new Rest endpoint, but I'm not so sure.

Load more comments