3 ms·
We're forgetting an elephant in the room. REST APIs make it easy to cache data. Do a GET /api/objects/123, and if the object hasn't changed since last time we'l
by blacklight 4y ago
We're forgetting an elephant in the room. REST APIs make it easy to cache data. Do a GET /api/objects/123, and if the object hasn't changed since last time we'll hit the cache. You can't do that with GraphQL, because a URL doesn't descrive a single resource.
What I like doing is to create a REST layer that sits just on top of the database, and a GraphQL layer on top of it that allows all kind of fancy queries. Yes, HTTP is slow and multiple calls for a single request should be avoided if possible. But it's much easier to run server-to-server HTTP calls (especially if the servers live in the same DC or physical machine) than running client-to-server requests.
- OrangeMusic 4y agoYou may find this article interesting: https://xuorig.medium.com/no-graphql-persisted-queries-are-not-re-inventing-a-rest-api-dcca7e876f7d https://xuorig.medium.com/no-graphql-persisted-queries-are-n...