Live data from Hacker News

GraphQL kinda sucks

news.ycombinator.com

1–10 of 448 posts

GraphQL kinda sucks

#1
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

Re: GraphQL kinda sucks

#4
As far as the versioning goes, the prevailing wisdom seems to be that it just isn't needed on graphql apis - on graphql.org they say the best practice is to avoid breaking changes. [1]

That said, versioning of a graphql api has been done at scale before. Shopify has done it, using versioning in the URL, specifically their admin data api, using month-year release dates as the versions [2]

[1]: https://graphql.org/learn/best-practices/

[2]: https://shopify.dev/api/usage/versioning

Re: GraphQL kinda sucks

#8

Earlier quoted context omitted.

Making a regular api

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

> 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

Re: GraphQL kinda sucks

#9

As far as the versioning goes, the prevailing wisdom seems to be that it just isn't needed on graphql apis - on graphql.org they say the best practice is to avoid breaking changes. [1] That said, versioning of a graphql api has been done at scale before. Shopify has done it, using versioning in the URL, specifically their admin data api, using month-year release dates as the versions [2] [1]: https://graphql.org/lear…

> As far as the versioning goes, the prevailing wisdom seems to be that it just isn't needed on graphql apis

In reality, of course API versioning is needed.

The "prevailing wisdom" is people who like the tool, don't like its limitations, and want to pretend it isn't a problem.

.

> That said, versioning of a graphql api has been done at scale before. Shopify has done it

Perl people will happily point out that object systems exist for Perl.

Having it not be a standard, uniform part of the core tool is a severe limitation. Shopify needed this rudimentary feature, and tried to give it away because others need it to, and the tool vendors aren't willing (or able) to deliver.

Post reply on HN