Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Sorry, I'm a bit new to GraphQL. Can you explain why this is more existing than starting a brand new product using plain PostgreSQL?

Can you also explain how locked in you are, if you decide you want to migrate away from Hasura, or in general want more flexibility that the use-case of Hasura + ForestryAdmin?



With plain PostgreSQL you have to write your own backend logic to access the database. The whole point of Hasura is exposing your DB via a GraphQL API with some bells and whistles (like authorization).

About lock-in... it's open source software, so you're as locked in as you'd be with, say, Rails or Django. It doesn't do anything special to PostgreSQL so you can always rewrite the API later from scratch, or build something else on top of its GraphQL API.


With some frameworks (i.e. ASP.NET core) you already have authentication and authorization middleware if you need them and you can use an ORM to map data objects to tables and query the DB with ease.

What benefits would be using the DB over a GraphQL API?


Well, not having to implement and maintain anything is a huge plus, especially when you have a large number of tables :)

Also, Hasura has some bells and whistles that would be a bit of a PITA to implement using traditional MVC frameworks, like per-column authorization, and, of course, the GraphQL to SQL translator.

> What benefits would be using the DB over a GraphQL API?

And I'd say that the biggest advantage of GraphQL is allowing customized payloads.

Say you need a list of users ids + emails in one page, and a list with ids + names + emails in other. In REST you either need to waste some bytes, have two endpoints, or use some conditional to show/hide the field.

With GraphQL you just have to ask for the fields you want.

The same applies to joins: you either add extra endpoints, extra logic, or the user has to make multiple requests. With GraphQL you can have custom joins.

Btw, if you still don't think that GraphQL is an advantage to you, I recommend checking its cousin-project PostgREST :)


So it's similar to http://postgrest.org/en/latest/ but for GraphQL, and commercial?


GraphQL yes. But it's open source under the Apache License, code is in Github:

https://github.com/hasura/graphql-engine/




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: