3 ms·
Fair point: GraphQL is mostly a data retrieval protocol that helps you retrieve specific data as stored by the app. SQL also provides data transformation with g
by ako 5y ago
Fair point: GraphQL is mostly a data retrieval protocol that helps you retrieve specific data as stored by the app. SQL also provides data transformation with grouping, aggregations, functions, where clauses, views, subqueries, etc. You could implement that in the resolver, but then you're at the mercy of the api implementer.
- joshribakoff 5y agoYou can use SQL in your resolver, like you mention. Note you’re also at the mercy of the API implementor if they use SQL in a REST endpoint. GQL also has some affordance for renaming fields (although admittedly nothing like SQL for the client, if you did allow running sql via the client it would be harder to sanitize, so this is a “feature” not a “bug”)
- ako 5y agoOdata or postgrest offer rest apis that are closer to the functionality of Sql.