Re:GraphQL vs. REST APIs: a complete guide
by JanisErdmanis on Friday March 03, 2023 @06:17PM
(#35016322)
The naming of "resource" is a bit unsettling. From the perspective of the server, it seems natural to think of all databases and external machines. "Representation" sits better with me, but ultimately in the code, I would prefer to name the REST endpoint as a "service".
Re:GraphQL vs. REST APIs: a complete guide
by nonethewiser on Friday March 03, 2023 @06:21PM
(#35016341)
REST is such a bastardized term. At this point it’s often used synonymously with JSON/HTTP or simply meant to contrast between SOAP, GQL, gRPC, etc. without respect to its actual tenants.
Furthermore, I believe that a huge confusion comes from not understanding what a "resource" is: it is not a database table; it is not your domain model; it is a _representation of state_. Like this very orange page you're looking at. This whole page is the resource identified by https://news.ycombinator.com/item?id=35014395. Just like the stylesheet for this website is a resource identified by https://news.ycombinator.com/news.css.
* It may be, if that's the _representation_ you want.