<sigh>
I grow so weary seeing these paeans to GraphQL claiming it is some kind of panacea and that REST is yesterdays news. Why? Why? Because they gloss over the fact that REST and GraphQL are really best for different use-cases.
So these "GraphQL is the future!" are tiring and tedious. Use the right tool for the job.
It makes me wonder if the authors of these types of posts actually understand REST, its history and what it was designed for or if they really only speaking from their own limited experience of having tried to write clients for both of them and found one easier to work with? That is a lot like blind men arguing over the nature of an elephant.
But since I don't want to be critical of someone I've never met and only read one article from, let me instead suggest they study more about REST before proliferating untruths unintentionally:
Saying "GraphQL is better than REST" is like saying an SUV is better than a bullet train simply because you get to control the SUV and you can go more places with an SUV than a bullet train. Though the latter parts of that statement would be correct the assertion that that makes an SUV "better" completely ignore the benefits of the bullet train and the respective trade-offs of choosing an SUV.
Absolutely, an SUV has its use-cases where it is better than a bullet train. But where a bullet train shines, an SUV cannot compete.
GraphQL use is highly coupled between client and server and when building bespoke mobile apps that is an acceptable tradeoff given its benefits. This is fine if your API is proprietary and/or don't expect your API to live more than a few years. Then you can gain the benefits of smaller and more exact payloads.
But REST, with its hypermedia constraint in tact, was designed to be robust and workable over decades. It was designed to decouple the client from the server as much as possible, and allow clients to interact with servers without having the client developer coordinate with the server developer, or coordinate as little as possible.
So to say the GraphQL replaces the need for REST is a gross misunderstanding of why REST is here to stay. After all, REST was merely a codification of the architecture of the web after the fact, albeit REST APIs need to adhere to more constraint than the we at large.
For those of you who read the post I am commenting on, or similar posts, and are tempted to think "Wow, REST is stupid and GraphQL is a panacea!" do yourself a favor and read these articles which provide a more balanced view of REST vs. GraphQL: