For the love of god, this is never how GraphQL was intended to be used. The official graphql website is very clear: https://graphql.org/learn/authorization/ > Delegate authorization logic to the business logic layer If you take security or performance debugging seriously, you should never expose database models through APIs directly in a production app. To illustrate, say you have an Employee model: query { employee(…
The solution to this should be to use the db's security/permissions model. For example, with postgres: https://stackoverflow.com/questions/49261452/combining-row-l...
GraphQLize: JVM library to build GraphQL API instantly from PostgreSQL and MySQL
11–20 of 61 posts
Re: GraphQLize: JVM library to build GraphQL API instantly from PostgreSQL and MySQL
#12Earlier quoted context omitted.
The solution to this should be to use the db's security/permissions model. For example, with postgres: https://stackoverflow.com/questions/49261452/combining-row-l...
i was thinking this, too. http://postgrest.org/en/v6.0/ comes to mind. Its security is based on postgres user permissions.
Re: GraphQLize: JVM library to build GraphQL API instantly from PostgreSQL and MySQL
#13For the love of god, this is never how GraphQL was intended to be used. The official graphql website is very clear: https://graphql.org/learn/authorization/ > Delegate authorization logic to the business logic layer If you take security or performance debugging seriously, you should never expose database models through APIs directly in a production app. To illustrate, say you have an Employee model: query { employee(…
I agree that this is indeed a problem, but your proposed cure is unnecessarily onerous. At least with Hasura's equivalent product, allowing queries on related objects is an opt-in process for the admin, after each related object is defined. I think a better piece of advice is: Please stop allowing people to query relational models automatically, and surface a separate locked-down schema for the GraphQL user. These Gr…
Re: GraphQLize: JVM library to build GraphQL API instantly from PostgreSQL and MySQL
#14Re: GraphQLize: JVM library to build GraphQL API instantly from PostgreSQL and MySQL
#15Earlier quoted context omitted.
i was thinking this, too. http://postgrest.org/en/v6.0/ comes to mind. Its security is based on postgres user permissions.
Separate DB user per application user makes connection pooling difficult. And PostgreSQL has more costly connections
Re: GraphQLize: JVM library to build GraphQL API instantly from PostgreSQL and MySQL
#16Re: GraphQLize: JVM library to build GraphQL API instantly from PostgreSQL and MySQL
#17Re: GraphQLize: JVM library to build GraphQL API instantly from PostgreSQL and MySQL
#18I understand this stuff is "cool" but this is only one step removed from db->query(input[sql]). I'm not talking about SQL injection either, I'm talking about wholesale data exfiltration of your entire database because you've auto-generated some slick GraphQL API and you don't take the time to think through what should, and should not, be exposed to end users or bother to implement any form of access control.
Re: GraphQLize: JVM library to build GraphQL API instantly from PostgreSQL and MySQL
#19Re: GraphQLize: JVM library to build GraphQL API instantly from PostgreSQL and MySQL
#20Been playing around with GraphQL in the last day or so and just can't see any reason to use it over REST (or REST + an ORM). Am I missing something? Is it just so people don't have to learn SQL?