News for hackers. Stuff that matters.
Re:Show HN: Hasura – Fast, instant GraphQL APIs on Postgres by tango12 on Monday July 16, 2018 @07:19AM (#17540365)
Hi HN! Super happy to announce the first open-source release of the Hasura GraphQL engine.

This is a standalone service that gives you GraphQL on Postgres. It comes with fine-grained access control that can integrate with any auth provider. It can also work with any existing postgres database as is, and allows you to expose select tables/views across your postgres schemas over GraphQL.

Looking forward to your feedback!

Re:Show HN: Hasura – Fast, instant GraphQL APIs on Postgres by bsaul on Monday July 16, 2018 @07:42AM (#17540480)
Thanks for releasing such a project. Your website is really well done, it immediately made me want to dig in the tech, congrats !

PS: as a sidenote and since i'm sure you'll get the question a lot : when i saw it was coded in haskell i was a bit nervous, but at the same time a bit more confident this wasn't another junior-level spaghetti code base.

Re:Show HN: Hasura – Fast, instant GraphQL APIs on Postgres by tango12 on Monday July 16, 2018 @07:58AM (#17540567)
Haha, yes we do this get this a lot!

We're also planning to release a lot of cool GraphQL OSS stuff for the haskell community because of our work over the last year.

Re:Show HN: Hasura – Fast, instant GraphQL APIs on Postgres by vetinari on Monday July 16, 2018 @08:49AM (#17540866)
Any comparison with PostGraphile?
Re:Show HN: Hasura – Fast, instant GraphQL APIs on Postgres by vsurabhi on Monday July 16, 2018 @09:31AM (#17541100)
Very similar projects ! The emphasis of Hasura is to make it seamless to work with existing databases.

The primary difference is how authorization is handled. In Postgraphile, you map your application roles to Postgres users and define policies using Postgres's RLS. With Hasura, you define rules on roles (similar to Postgres's RLS) but it integrates into your existing auth system using webhooks.

Re:Show HN: Hasura – Fast, instant GraphQL APIs on Postgres by rogerrohrbach on Wednesday July 18, 2018 @07:03PM (#17562745)
Another salient difference (and, for me, a deal-breaker): PostGraphile exposes user-defined functions in the GraphQL API, making it possible to define application logic and build a complete service without recourse to any other server-side technology.
Re:Show HN: Hasura – Fast, instant GraphQL APIs on Postgres by tango12 on Thursday July 19, 2018 @12:51AM (#17563981)
True! We actually do support this via triggers at the moment; but exposing UDFs directly is on our roadmap too.
Re:Show HN: Hasura – Fast, instant GraphQL APIs on Postgres by rogerrohrbach on Thursday July 26, 2018 @05:05PM (#17621120)
Ah—good to know!
Re:Show HN: Hasura – Fast, instant GraphQL APIs on Postgres by fictorial on Monday July 16, 2018 @10:43AM (#17541627)
Would you mind expanding on this a bit? It seems HGE makes a call to a webhook for every GraphQL query/mutation [1]? This sounds rather expensive to me. Thanks!

[1] https://docs.hasura.io/1.0/graphql/manual/auth/index.html

Re:Show HN: Hasura – Fast, instant GraphQL APIs on Postgres by tango12 on Monday July 16, 2018 @11:44AM (#17542191)
We're adding support for JWT soon too which should prevent this overhead for applications that support JWT. But basically the idea here is to be equivalent to session cache hit.

Another deployment pattern is to make everything go through an API gateway which would usually do the auth resolution for all microservices, and thus can set the dynamic variables required for access control for HGE directly too. In this case, auth-webhook is disabled.

Re:Show HN: Hasura – Fast, instant GraphQL APIs on Postgres by ASTP001 on Monday July 16, 2018 @04:03PM (#17544600)
This looks great! Is there any interface for extracting encrypted columns through this? For example, decrypting fernet encrypted values, given the key?
Re:Show HN: Hasura – Fast, instant GraphQL APIs on Postgres by minxomat on Monday July 16, 2018 @07:35AM (#17540446)
How does this project relate to prisma?
Re:Show HN: Hasura – Fast, instant GraphQL APIs on Postgres by vsurabhi on Monday July 16, 2018 @08:09AM (#17540632)
Hi, I'm one of the core contributors to the project.

Hasura and Prisma have very different approaches and end-goals at the moment.

TL;DR: Very simply put, Hasura is postgres first and adds an access-control layer to make it possible to query from the front end directly.

The longer version:

Prisma is intended to be a GraphQL ORM to Postgres (and several other databases with a common API) whereas Hasura is more database first and intended to let you leverage Postgres features over GraphQL.

Hasura comes with and lets you use any postgres migration system and then gives you GraphQL on top of it. This is what allows Hasura to give you GraphQL over any existing Postgres database and application even.

Hasura also comes with an optional access-control layer that makes it feasible to be used by frontend clients directly. This access control is inspired from postgres's RLS but does not depend on or use postgres RLS and can be coupled with application logic/auth.

Re:Show HN: Hasura – Fast, instant GraphQL APIs on Postgres by filleokus on Monday July 16, 2018 @09:34AM (#17541135)
> Prisma is intended to be a GraphQL ORM to Postgres

Sorry to be hijacking this thread, but how would you say Prisma compares to something like Graphene (with an appropriate ORM adapter). I've only used Graphene with Python and the SQLAlchemy adapter, but it sounds pretty similar? Is Prisma typically used as the only ORM in project, or is it used in conjunction with some other ORM?

Re:Show HN: Hasura – Fast, instant GraphQL APIs on Postgres by sorenbs on Monday July 16, 2018 @01:40PM (#17543199)
Happy to provide a more thorough answer :-)

You should think of Prisma as the data layer for your applications. If you look at large tech companies who are typically ahead of the status quo for how to build applications, then you see that there is a trend to move away from traditional ORMs.

Twitter has a service called Strato that manages data access for all their services. Facebook has TAO that serves a similar role. Prisma is an open source implementation of that pattern.

If you are building a GraphQL API using for example Graphene, then you could use Prisma as your data layer, but Prisma can also be used in non-GraphQL applications. If you are using the Nodejs implementation, then you can take advantage of schema delegation to simplify the implementation of your resolvers. The GraphQL ecosystem is still evolving, so these capabilities will come to more languages in the future.

So in short - Prisma replaces SQLAlchemy, not Graphene. Hope that provides some clarity :-)

Re:Show HN: Hasura – Fast, instant GraphQL APIs on Postgres by vsurabhi on Monday July 16, 2018 @10:04AM (#17541295)
I think you should be able to use it alongside SQLAlchemy if you manage your schema through Prisma. Someone from Prisma team should be able to give you a more thorough answer.
Re:Show HN: Hasura – Fast, instant GraphQL APIs on Postgres by tirumaraiselvan on Monday July 16, 2018 @08:04AM (#17540600)
Prisma doesn't work with existing postgres or access-controls.
Re:Show HN: Hasura – Fast, instant GraphQL APIs on Postgres by sorenbs on Monday July 16, 2018 @08:31AM (#17540743)
Hi Tirumari :-) (https://twitter.com/Tirumarai)

As you work at Hasura I assume you are aware that Prisma does work with existing postgres databases. You can look up the documentation for introspecting an existing database at https://www.prisma.io/docs/reference/service-configuration/d...

Full disclosure - I am the co-founder of Prisma.

Re:Show HN: Hasura – Fast, instant GraphQL APIs on Postgres by tirumaraiselvan on Monday July 16, 2018 @08:54AM (#17540905)
My bad. I was looking at this page which says 'coming soon': https://www.prisma.io/docs/tutorials/setup-prisma/connect-db...