Live data from Hacker News

GraphQL: The enterprise honeymoon is over

johnjames.blog

91–100 of 241 posts

Re: GraphQL: The enterprise honeymoon is over

#91
post #3

i wrote this a few weeks ago: https://gist.github.com/andrewarrow/c75c7a3fedda9abb8fd1af14... 400 lines of QL vs one rest DELETE / endpoint

I feel you. But I think this might have more to do with the cursed design of the Shopify order editing API than with GraphQL itself.

Re: GraphQL: The enterprise honeymoon is over

#92
post #41

How do GraphQL based systems solve the problem of underlying database thrashing, hot shards, ballooning inner joins, and other standard database issues? What prevents a client from writing some adversarial-level cursed query that causes massive internal state buildup? I’m not a database neckbeard but I’ve always been confused how GraphQL doesn’t require throwing all systems knowledge about databases out the window

Most servers implement a heuristic for "query cost/complexity" with a configurable max. At the time the query is parsed, its cost is determined based on the heuristic and if it is over the max, the query is rejected.

Which would be fine for internal facing, but it doesn’t sound like it would be enough in an adversarial context?

Re: GraphQL: The enterprise honeymoon is over

#93
It depends very much on the language/server you are using. In Rust, IMO GraphQL is still the best, easiest and fastest way to have my Rust types propagated to the frontend(s) and making sure that I will have strict and maitainable contracts throughout the whole system. This is achieved via the "async_graphql" crate which allows you to define/generate the GraphQL schema in code, by implementing the field handlers.

If you are using something which requires you to write the GraphQL schema manually and then adapt both the server and the client... it's a completely different experience and not that pleasant at all.

Re: GraphQL: The enterprise honeymoon is over

#94
This doesn’t really make sense. Obviously if you combine GQL with BFF/REST you’re gonna have annoying double-work —- you’re solving the same problem twice. GQL lets you structure your backend into semantic objects then have the frontend do whatever it wants without extra backend changes. Which lets frontend devs move way faster.

Re: GraphQL: The enterprise honeymoon is over

#96
I get the impression that GraphQL only got popular because it was backed by behemoth Facebook.

But the other graph query language "Cypher" always seemed a lot more intuitive to me.

Are they really trying to solve such different problems? Cypher seems much more flexible.

Re: GraphQL: The enterprise honeymoon is over

#97

The article pretty much sums up why I've been a bigger fan of OData than GraphQL, especially in the business cases. OData will still let you get all those same wins that GraphQL does but without a sql-ish query syntax, and sticking to the REST roots that the web works better with. Also helps that lots of Microsoft services work out of the box with OData.

Is there an article that explains OData? The articles I have seen did such a poor job I came away with the impression that it was a dead tech.

Re: GraphQL: The enterprise honeymoon is over

#98

I'm probably about as qualified to talk about GraphQL as anyone on the internet: I started using it in late 2016, back when Apollo was just an alternate client-side state/store library. The internet at large seems to have a fundamental misunderstanding about what GraphQL is/is not. Put simply: GQL is an RPC spec that is essentially implemented as a Dict/Key-Value Map on the server, of the form: "Action(Args) -> Resul…

As someone who’s used GraphQL since mid-2015, if you haven’t used GraphQL with Relay you probably haven’t experienced GraphQL in a way that truly exploits its strengths. I say probably because in the last ~year Apollo shipped functionality (fragment masking) that brings it closer. I stand by my oft-repeated statement that I don’t use Relay because I need a React GraphQL client, I use GraphQL because I really want to…

Can you elaborate? I've used URQL and Apollo with graphql code gen for type safety and am a big fan.

What about relay is so compelling for you? I'm not disagreeing, just genuinely curious since I've never really used it.

Re: GraphQL: The enterprise honeymoon is over

#99

Earlier quoted context omitted.

Most servers implement a heuristic for "query cost/complexity" with a configurable max. At the time the query is parsed, its cost is determined based on the heuristic and if it is over the max, the query is rejected.

Which would be fine for internal facing, but it doesn’t sound like it would be enough in an adversarial context?

There are a lot of public facing graphql servers that use it without issue other than frustrating users of non adversarial but complex requirements. The problem is that it is generally on a per request basis.

An adversary is going to utilize more than a single query. It mostly protects against well intentioned folks.

Other forms of protection such as rate limiting are needed for threat models that involve an adversary.

The same problems exist with REST but there it is easier as you can know query complexity ahead of time at end points. GraphQL has to have something to account for the unknown query complexity, thus the additional heuristics.

Re: GraphQL: The enterprise honeymoon is over

#100
post #77

We have a BFF and were considering for a while to go with GQL but eventually scrapped the idea: it seemed like a lot of work on the BE side. But, we are quite constraint on resources, so now even the BFF seems to consume more and more BE development time. Now we are considering letting the FE use some sort of bridge to the BE's db layer in order to directly CRUD what it needs and therefore skip the BFF API. That db l…

Postgrest and hasura are like the quintessential "some sort of bridge to the BE's db layer".
Post reply on HN