TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: How long will it take for GraphQL(or else) to take over REST?

4 pointsby sanmakabout 4 years ago

6 comments

PragmaticPulpabout 4 years ago
GraphQL isn&#x27;t a replacement for REST.<p>REST is great for most applications. GraphQL is helpful in some specific applications where the benefits outweigh the downsides of additional complexity, but it shouldn&#x27;t be viewed as universally superior to REST.
nerdywordyabout 4 years ago
REST itself is such an amorphous term nowadays that it&#x27;s tough to even measure&#x2F;define this. It seems to now mean basically any multi-endpoint based JSON API.<p>GraphQL is trendy and might take over &quot;REST&quot; for startups soon if it hasn&#x27;t already. But in real-world adoption in established companies and dev teams I&#x27;m not sure that it ever will. REST &#x2F; typical JSON APIs are so prevalent because they are fully backend agnostic and so darn easy to write (Note: not easy to write well). GraphQL has some architecture and typed overhead to learn prior to spinning up an endpoint and the underlying logic to stitch together the data. With REST, it&#x27;s just HTTP call, backend processes call, return JSON, done.
PaulHouleabout 4 years ago
On one level never, so long as http is the dominant protocol.<p>For some things REST is appropriate, for other things it is not.<p>I am impressed with websockets; it&#x27;s easy to make a web page that controls your smart lights, stereo volumes and such where the updating is symmetrical: not only does clicking on the HTML button toggle the light, the web page changes when the light is toggled from a different switch.<p>With the right backend a business application could do the following: you are looking at a customer record that shows the order hasn&#x27;t shipped yet, the page updates the instant the order is shipped instead of requiring a reload.<p>The other thing I would look at is web workers, service workers, and indexed storage. One scenario is:<p>you want to read the manuals for your favorite programming language on your computer disconnected from the net; a web app creates a Service Worker that downloads all the web pages as a brotli tar file (not ZIP for many reasons) and stores them in IndexedStorage on your browser: the Service Worker then acts like an http server integrated that serves the pages of the manual.<p>If you want to avoid the baggage of http you can also create a Web Worker and communicate with it with JSON messages, a little like having a local &quot;websocket server&quot;.<p>Those tech have not been used much because the coding is tricky and the most popular framework so far is<p><a href="https:&#x2F;&#x2F;developers.google.com&#x2F;web&#x2F;tools&#x2F;workbox&#x2F;" rel="nofollow">https:&#x2F;&#x2F;developers.google.com&#x2F;web&#x2F;tools&#x2F;workbox&#x2F;</a><p>which really just complicates the cache behavior of the browser -- the probability that workbox will really speed up your app is about 0.01%, compared to something like the &quot;solid compressed tar&quot; approach which will have much better performance you can feel. (Like try the quarter mile in a Dodge Viper instead of a Honda Fit)<p>One could even picture a news site, for instance, that uses push updates, websockets, or polling, to update a user&#x27;s local copy of the site.
jkaabout 4 years ago
It&#x27;s imprecise for various reasons, but Google Trends is often good at providing a brief assessment in situations like this. It does appear useful here too:<p><a href="https:&#x2F;&#x2F;trends.google.com&#x2F;trends&#x2F;explore?date=all&amp;q=restful,graphql,grpc" rel="nofollow">https:&#x2F;&#x2F;trends.google.com&#x2F;trends&#x2F;explore?date=all&amp;q=restful,...</a><p>Edit: added grpc into the mix
runawaybottleabout 4 years ago
A typical frontend needs a heavy layer to connect properly with a gql endpoint. You also need somewhat black box type frameworks on the backend. You can make a REST http server just by understanding basic routes.<p>GQL is very black boxy when you think about the layers involved to expose it.
tracer4201about 4 years ago
I use graphql extensively at work, because it requires it. I wouldn’t use graphql if my use case was sufficiently solved with REST. And in most cases, it is. Saying graphql will take over rest is like saying apples will take over bananas.