DEV Community

Discussion on: GraphQL for PostgreSQL - Why?

Collapse
 
nans profile image
Nans Dumortier

Yes sure, but even if the user is authorized, I don't think we should simply let him run any query of his choice directly on the database.
RESTful services are, to me, a good way of orchestrating backend calls, and it has its pros and cons versus GraphQL.
To be honest I don't know GraphQL enough though !

Thread Thread
 
benbot profile image
Benjamin Botwin

Most db -> graphql layers (like hasura or postgraphile) respect and/or even take into account the security policies and roles of the db when generating the graphql schema (basically the list of types, queries, and mutations that you can use to build graphql queries).

A graphql query (basically a GET request) or mutations (basically a POST request) would never simply be mapped to a raw sql query.