| Performance isn't just latency - it's also about the requests and responses per second a service can handle. GQL notoriously performs weaker to REST in this regard. >When a user navigates to a page on a web app or deep links into a Single Page Application (SPA) or a particular view in a mobile app, the frontend application needs to call the backend service to fetch the data needed to render the view. With RESTful APIs, it is unlikely that a single call will be able to get all the data. Typically, one call is made, then the frontend code iterates through the results of that call and makes more API calls per result item to get all the data needed. >For example, I don’t want to navigate through multiple screens to review my travel itinerary; I want to see the summary (including flights, car rental, and hotel reservation) all on one screen before I commit to making the purchase. I disagree. Sure, sometimes more than one restful call is made for just one page, but the example given, when architectured properly is just a user foreign key relationship to all its children (reservations flights, rentals, etc), which is just a single sql query. I don't think the author really understand the flexibility of REST and how much it can emulate what GQL has to offer. If you want specificity in your query fetching, just add query params or put them in the request body And if it is the case that you really do need resources from different endpoints, what is preventing you to build that single endpoint in REST? |
Also, which properties of GQL make it inherently slower than REST ... ? Both are abstract concepts. (Also I'd argue that GQL is REST.)