3 ms·
Just personal taste. Without knowing the actual use case it doesn't make sense to judge. However, there's one thing that GraphQL CRUD APIs will always win over
by jensneuse 6y ago
Just personal taste. Without knowing the actual use case it doesn't make sense to judge. However, there's one thing that GraphQL CRUD APIs will always win over REST CRUD APIs and that's n+1. Smart enough GraphQL middlewares can turn any Query into a single SQL statement whereas with REST it can very easy become a waterfall of hundreds or thousands of requests. But again, if you don't have nested data you might not this feature.
- SahAssar 6y agoPostgrest has resource embedding that even works over join tables, so most relations should be no problem to include in a single request.
- steve-chavez 6y agoPostgREST has solved n+1 with resource embedding[1] since 2015(maybe a year before Postgraphql/Postgraphile was born). So GraphQL does not pose an inherent advantage over REST for doing this. [1]: http://postgrest.org/en/v7.0.0/api.html#resource-embedding http://postgrest.org/en/v7.0.0/api.html#resource-embedding
- jensneuse 6y agoI didn't know. Really nice!