Earlier quoted context omitted.
Especially since avoiding n+1 query situations involves hand optimizing a lot of stuff anyways. In my experience it's not really any less work than just aggregating stuff in a regular HTTP API, but it does seem to give a better developer experience on the frontend. At a certain scale, I think it could be worth the investment, but I don't think it really lives up to the hype.
> Especially since avoiding n+1 query situations involves hand optimizing a lot of stuff anyways. Rarely. Assuming the GraphQL server is using REST endpoints behind the scenes, i'm yet to find a request waterfall that required manual rather than automatic optimizations. I'm assuming there are cases where a manual path is faster, but they're less common that you'd think.
REST in Peace. Long Live GraphQL
51–60 of 94 posts
Re: REST in Peace. Long Live GraphQL
#52The reference implementation of GraphQL has a patent grant identical to React [1]. It does not seem wise to use anything with that rider if you have or would like to leave open the possibility of having patents which you license to / enforce against Facebook. The argument for patent disarmament strikes me as reasonable, but some companies have novel tech they would like to license to Facebook, and restricting the use…
might not be as bad as you think
Re: REST in Peace. Long Live GraphQL
#53Note that earlier the top story on HN was about MSPaint and the top comment said:
> "All the comments that "you can just use X to do Y" is missing the point that Paint just works"
REST still (and will continue to) just work for most people, I'm sure some will switch or some will go straight to GraphQL, but lets not just go ahead and declare the whole thing dead. Haha.
Re: REST in Peace. Long Live GraphQL
#54Earlier quoted context omitted.
> Especially since avoiding n+1 query situations involves hand optimizing a lot of stuff anyways. Rarely. Assuming the GraphQL server is using REST endpoints behind the scenes, i'm yet to find a request waterfall that required manual rather than automatic optimizations. I'm assuming there are cases where a manual path is faster, but they're less common that you'd think.
Not sure how magical your automatic optimizations are - but my experience does not at all mirror yours. i've certainly had to hand-optimize queries to improve performance, on top of the query already being automatically optimized. Removing unused data, tying across custom relations and moving things into different forms of caching are all quite manual efforts I've done plenty of. So, not sure how "less common than yo…
I haven't looked into optimising other types of architecture (eg GraphQL server talking directly to the database), but there seem to be plenty of solutions that people are happy with.
Re: REST in Peace. Long Live GraphQL
#55Anyone got experience transitioning a large production site from REST to GraphQL? I'm aware Yelp did this recently, wondering about any pain points. In particular, I have some FUD about how to go about rate limiting, when in theory a single request could grab every resource that the client is authorized to retrieve, and thrash the database. Looks like Github counts/restricts the number of total nodes returned: https:…
It goes over several ways to secure your endpoints, along with pros and cons for each.
Re: REST in Peace. Long Live GraphQL
#56Earlier quoted context omitted.
Especially since avoiding n+1 query situations involves hand optimizing a lot of stuff anyways. In my experience it's not really any less work than just aggregating stuff in a regular HTTP API, but it does seem to give a better developer experience on the frontend. At a certain scale, I think it could be worth the investment, but I don't think it really lives up to the hype.
well maybe on the frontend it looks good, but on the backend? meh parsing such a query is not painless. and maybe "simple" queries are looking good and simple, complex and bigger queries and big schema's are really really akward to implement.
Re: REST in Peace. Long Live GraphQL
#57What is GraphQL? GraphQL is all about data communication Somehow it reminds me of good old "The S stands for Simple": http://harmful.cat-v.org/software/xml/soap/simple
Thank you for reminding me harmful.cat-v exists, this stuff is hilarious.
Re: REST in Peace. Long Live GraphQL
#58Ok, there are a lot of reasons.
I worked on a project once that was essentially a "data platform", kind of a SQL firewall to "any data" (a bit of a stretch, but that was the concept). You could put any data system (relational, non-relational, web services, etc.) behind it, but then join across heterogeneous systems using plain old SQL. You had a query language and a network interface, and since it was separate from the actual databases themselves, you could do some interesting things with security, caching and scalability in a different layer.
GraphQL has always seemed like the same kind of query abstraction over data, with a network interface. Props to Facebook for making the tech and releasing it open source.
This also makes me think about the command query responsibility separation (CQRS) pattern, a similar discussion.
EDIT: Also, lest we forget OData... which never really took off, but offers similar functionality.
Re: REST in Peace. Long Live GraphQL
#59 "who in their right mind would use XML over JSON today?"
Lost me already... there are lots of reasons to still use XML today. And since someone is going to ask, here are some:* you want to use xpath
* you want to communicate with an enterprise app (salesforce, magento, etc)
* you need strongly-typed message-passing in a human-readable well-understood format (rules out messagepack, etc)
* nobody actually documented the API, but they might have a WSDL