GraphQLize: JVM library to build GraphQL API instantly from PostgreSQL and MySQL
1–10 of 61 posts
Re: GraphQLize: JVM library to build GraphQL API instantly from PostgreSQL and MySQL
#2I guess it is inevitable that somehow some sql database will be exposed via graphql, and someone will use something like presto to make it appear to be an SQL database again...
Re: GraphQLize: JVM library to build GraphQL API instantly from PostgreSQL and MySQL
#3Re: GraphQLize: JVM library to build GraphQL API instantly from PostgreSQL and MySQL
#4Re: GraphQLize: JVM library to build GraphQL API instantly from PostgreSQL and MySQL
#5Interested in comparing with Postgraphile. Besides JVM vs TypeScript.
Re: GraphQLize: JVM library to build GraphQL API instantly from PostgreSQL and MySQL
#6Re: GraphQLize: JVM library to build GraphQL API instantly from PostgreSQL and MySQL
#7https://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(userId=uuid) {
name
salary
}
}
Say you add some hacks on top of this to only allow users to query their own employee data, believing this provides adequate security.The next day, someone creates a Manager object, a relation from employee to Manager, and Manager to employee.
Now, without having consider security for a second, you've granted all employees the ability to query each other:
query {
employee(userId=uuid) {
name
salary
manager {
employees {
name
salary
}
}
}
}
To say that these problems occur in the wild frequently is an understatement. Since these graphql frameworks also expose introspection capabilities, discovering these exploits can be automated using crawlers. If you write a bug like this, and you will, people will find it.Please, please stop encouraging people to directly expose their databases through an API.
Re: GraphQLize: JVM library to build GraphQL API instantly from PostgreSQL and MySQL
#8Nice! Is it stable enough for production? Or at least as stable as PostgREST?
Re: GraphQLize: JVM library to build GraphQL API instantly from PostgreSQL and MySQL
#9For 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(…
For example, with postgres: https://stackoverflow.com/questions/49261452/combining-row-l...
Re: GraphQLize: JVM library to build GraphQL API instantly from PostgreSQL and MySQL
#10For 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 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 GraphQL over DB tools have real value. I've moved from using OpenResty to Hasura in order to surface Postgres APIs, and the time saved has been significant.