Live data from Hacker News

GraphQL kinda sucks

news.ycombinator.com

171–180 of 448 posts

Re: GraphQL kinda sucks

#171

I tried graphql in a microservices environment and had huge headaches over schema stitching. Turns out, if you have lots of objects from disparate sources, graphql don’t like that. Now you must stitch these schemas together into an über schema roll query and use with graphql. Maybe we missed a step. Maybe we misunderstood. Maybe it was a bad decision.

Same! We’ve been using WunderGraph to help with schema stitching and integrating other data sources

Re: GraphQL kinda sucks

#172
post #18

Whether it was the intention or not, I find GraphQL solved a fascinating problem: it let front end developers move faster by greatly decoupling their data needs from the backend developers. Backend developers describe the data model, expose it via graphql. Front end developers, often ones who never met those backend developers, can see the data model and just use it. They can change what they're querying on the fly,…

I get specialization, but are there any other good reasons to divide product teams between frontend and backend? I guess it also helps establish patterns and contracts, but I think those are only helpful above a critical mass that I haven’t reached in my career yet.

I think you are saying why not combine specialists on one team vs the “everyone is fullstack+devops” amateur hour dystopia that is becoming all too common?

Re: GraphQL kinda sucks

#173
post #35

Be careful with anyone with a take that says some technology is 100% bad always. Given enough experience / skill you can make any technology fairly enjoyable so I've only ever seen mixed reactions at worst from people giving things a fair try. GraphQL is a way to describe not only your API but also the entities and relationships in it. This enables certain useful things for client heavy applications, like cache norma…

> Be careful with anyone with a take that says some technology is 100% bad always. This isn’t that though; the first sentence starts “GraphQL is great, but” and then the post lists first “the good” and then “the bad.” Even the provocative headline hedges with “kinda.” I wish there was more of this sort of balanced discussion on HN. There is a tendency among devs at least in public toward trying to get others to use t…

was referring to some of the replies

Re: GraphQL kinda sucks

#174
post #153

My usual experiene is that people use GraphQL wrong. GraphQL's primary use case is to homogenize access to a bunch of heteregenous backend services. If you find yourself just taking your Postgres database and creating a 1:1 mapping between your tables and GraphQL, this probably isn't a good fit as you'r ejust adding another layer for no reason. > No clear path for Api versioning GraphQL came about as a way for mobile…

My company has many backends federated together, but a monolithic, web-based frontend. It’s actually really easy to remove a field from graphql.

1. Remove all uses from the frontend. 2. Deploy. 3. A day later, delete it from the schema.

If deleting it causes relay compiler errors, go back to step 1.

(The less lazy way to do it would be to actually pull some stats about how long-lived frontend bundles are)

Not being able to delete fields only really applies if you have a huge number of clients that you can’t easily force to update on a whim. Plenty of folks just have web clients.

My company doesn’t have this, but I’d love to get per-field usage stats about our schema.

Re: GraphQL kinda sucks

#175
I feel 2 critical points are missing in the bad things: some control and security on the backend side, and more importantly scaling. Did these things got fixed? What is the cost on the cloud versus the same backend with an API (I saw a horrible story about that). Can I cache queries efficiently? Is it efficient and fast with high throughput of RPS? Or tell GraphQL to use Redis for some data? Etc...

Re: GraphQL kinda sucks

#176
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.

Re: GraphQL kinda sucks

#177
Some nits:

> It doesn't support map/tables/dictionaries. This is actually huge. I get that there might be

It does. You can define, say, an "any" or "json" type in your schema and emit anything you want at a field with such a type. For example https://stackoverflow.com/a/63588485

> No clear path for Api versioning

Some options include:

- Prefixes (`/v1/graphql`, `/v2/graphql`)

- Backward compatibility: only adding and not subtracting things you want to support.

Lots of fair criticisms though. My two cents:

There are very few cases for starting a GraphQL based project by writing a GraphQL server (resolvers, queries, etc). This is where devs waste time instead of exploring their concepts. Instead, use GraphQL with something like Hasura that generates the GraphQL service for you based on database schema.

Re: GraphQL kinda sucks

#178
when I talked about drawbacks of graphql like 3 years ago - I got ridiculed. there surely are some nice perks but overall - I find the maintenance of that tricky abstraction layer way too exhaustive. then there's that (weird) architecture in which all the data goes through single focal graphql endpoint. I mean - there's already painful client/server division in web world but now the server knows near nothing about the client intent.

Re: GraphQL kinda sucks

#179
post #76

Having worked in big tech and small startups, I think GraphQL is a brilliant way to solve an organizational problem that massive tech companies have. It's that the team maintaining the API is different from the team that needs changes to the API. Due to the scale of the organization the latter doesn't have the access or know-how to easily add fields to that API themselves, so they have to wait for the maintainers to…

I used to see GraphQL (and to an uglier respect Soap like interfaces) as complicated solutions to that problem you describe.

But more and more, I think Backend For Frontends solve this issue in a much better way. And of course that idea isn’t new and Yahoo for instance had that kind of architecture.

Frontend teams get to adjust by themselves a simple interface to their needs, and backend teams can provide more info through internal APIs with less restrictions than if it was directly exposed to the outside.

Re: GraphQL kinda sucks

#180

Earlier quoted context omitted.

If that field isn’t populated aren’t you in the exact same spot?

Let's say you need to get a field back that is already in the database table, but that wasn't previously returned by the GraphQL endpoint. All you have to do on the front end is ask for it and GraphQL will populate it for you on the server.

If your GraphQL schema is just a mapping of database tables, in my experience you are in for a world of hurt in the future.
Post reply on HN