Live data from Hacker News

Hasura raises $9.9M to simplify GraphQL

techcrunch.com

131–140 of 199 posts

Re: Hasura raises $9.9M to simplify GraphQL

#131

Earlier quoted context omitted.

Django has had an automatic admin site since 2006 or earlier, this isn't a game changer for me.

These aren't the same things. Hasura is not an admin interface, although it provides something like one. It's an application API. The django admin interface is not usable by a frontend as an application API. Django requires you to "meta-model" you have to write Python classes that map to your tables, this is usually duplicate work. Django's ORM must support many databases, so it produces "least common denominator" SQ…

> Django requires you to "meta-model" you have to write Python classes that map to your tables, this is usually duplicate work.

You don't have to duplicate any work because you don't actually have to write any raw SQL, since it all gets translated by Django. So yes, there's an extra layer of abstraction there, but no duplication on the developer's part.

> Django's ORM must support many databases, so it produces "least common denominator" SQL and is (stock) oblivious to Postgres' many enhanced data features, you are forced to use various community sourced extensions to get access to features that have been in postgres now for many years.

Practically every Django release adds support for more and more database-specific features out of the box, to the point where I don't remember the last time I had to use a third-party library to take advantage of a PostgreSQL feature. But even if you do, so what? It's no different than using a Postgres extension.

The HUGE advantage that ORMs like Django, Rails, etc have over writing raw SQL is their composability. Django provides lots of tools that make it VERY easy to reuse code relating to models and querysets, whereas SQL is notoriously difficult to keep DRY. And this issue gets significantly worse when you start to pull in data that lives outside of the DB.

On top of that, there is the more obvious issue that good DBAs are rare and expensive compared to Python/Ruby/whatever engineers.

> Django's security system is django only. You are forced to go through django for access control across your business. Eventually this abstraction leaks, and someone starts logging into the db from some other framework and now you have two problems.

I do completely agree with this, and I think it's Django's weakest point by far. But you can always forego the ORM's integrity/trigger features and add those at the database level in your migrations.

> This is my opinion and I'm sure I'll get downvoted for it, but Django, Rails, Node, all the Java frameworks, all the meta-modeling and NIH syndroming, are all utterly obsolete.

Hasura and related projects are really great, don't get me wrong, but this is outright FUD. There are pros and cons to both approaches, and to claim that one is "utterly obsolete" is nonsense. There are lots of situations in which turning the database into your API just doesn't make sense.

Re: Hasura raises $9.9M to simplify GraphQL

#132
post #53

Some major players in the "GraphQL in a box" space: https://www.graphile.org/postgraphile/ https://hasura.io/ https://www.prisma.io/ There are plenty of "REST API in a box" solutions as well: https://github.com/PostgREST/postgrest https://github.com/prest/prest https://resthapi.com/

I've been working on GraphQL services since 2015. I worked on the design of the precursor to postgraphile; it was called postgraphql. Hadn't heard of Hasura before today, but it looks interesting. The primary complaints I hear from others about GraphQL are observability and the learning curve for devs who are new to it. I think these projects add a lot of value with tools like the GraphQL playground (similar to Graph…

Curious if you were active on the precursor to postgraphile why you feel Prisma is a better option. It's been my experience as well, but would love to hear what the deciding factors were for you.

Re: Hasura raises $9.9M to simplify GraphQL

#133
post #37

If GraphQL needs $9.9M to be simple enough for developers to actually use it, why was it invented?

GraphQL is mediocre. It's luke-warm mashed potatoes from a chain diner. Having used it for a number of years now, I still don't know why people recommend it beyond other people recommending it. Out of the box, it comes with no batteries included. Which explains the cottage industry that popped up to support it (Apollo, Hasura, etc.). Simply making GraphQL as efficient as bog-standard REST without involving the use of…

Apollo is more than just GraphQL -- it has built-in caching, and gives you booleans for loading state, and more. If you were to roll your own wrapper around window.fetch, for a simpler facade to work with (when making network requests in React), you'd end up with something like Apollo's interface. And that really useful API surface has nothing to do with GraphQL as a specification.

I used to roll all of this stuff from Redux, with actions, reducers, the whole 9 yards. Apollo let me gut all of that-- since I was only using Redux to store data retrieved over the network. Now I'm not hear to preach Apollo specifically, but it's the only client I've worked with, and I can achieve higher productivity with it than working a lower level.

Re: Hasura raises $9.9M to simplify GraphQL

#134
post #22

This is fantastic to see. First time I tried out Hasura back in late 2018 I was AMAZED. After going through multiple different stacks such as MeteorJS, Firebase, building my own REST/GraphQL API etc. Nothing really felt right. That was until I found out about Hasura. I actually had to assemble a quick meetup at the co-working space I was on (true story) to show everybody this software. Hasura Tweet: https://twitter.c…

Just tried hasura, it is amazing to get all crud graphql apis out of box.

How do we add business logic ?

Folks @hasura, where do we learn about haskell ? any helpful pointers much appreciated.

Re: Hasura raises $9.9M to simplify GraphQL

#135
post #134
post #22

This is fantastic to see. First time I tried out Hasura back in late 2018 I was AMAZED. After going through multiple different stacks such as MeteorJS, Firebase, building my own REST/GraphQL API etc. Nothing really felt right. That was until I found out about Hasura. I actually had to assemble a quick meetup at the co-working space I was on (true story) to show everybody this software. Hasura Tweet: https://twitter.c…

Just tried hasura, it is amazing to get all crud graphql apis out of box. How do we add business logic ? Folks @hasura, where do we learn about haskell ? any helpful pointers much appreciated.

For business logic, there are a few alternatives.

1. Actions - https://hasura.io/docs/1.0/graphql/manual/actions/index.html

2. https://3factor.app/

3. Remote schemas - https://hasura.io/docs/1.0/graphql/manual/remote-schemas/ind...

Re: Hasura raises $9.9M to simplify GraphQL

#136
post #105

Earlier quoted context omitted.

I ultimately chose Postgraphile over Hasura. Mostly because the Postgraphile codebase seemed way hackable, written in TS/JS with a plugin architecture. I've tried some Haskell and that's just a whole nother world I don't have time to learn. So far it's working great for me.

FWIW, I went the other way, mostly because I found the GraphQL queries that I wrote in Hasura to be much nicer to read than the equivalents that I got with Postgraphile.

Wow that's interesting! I chose Postgraphile exactly for this reason: because it lets me customize the schema to a degree that looks just as if I had written it by hand. I found the schema created by Hasura incredibly verbose.

Re: Hasura raises $9.9M to simplify GraphQL

#137

Earlier quoted context omitted.

GraphQL is mediocre. It's luke-warm mashed potatoes from a chain diner. Having used it for a number of years now, I still don't know why people recommend it beyond other people recommending it. Out of the box, it comes with no batteries included. Which explains the cottage industry that popped up to support it (Apollo, Hasura, etc.). Simply making GraphQL as efficient as bog-standard REST without involving the use of…

After using GraphQL with code-generated Typescript types on the response, I can't imagine going back to REST and it's "hope and pray" the JSON looks how you expect it to look

I think part of the actual, non-hyped benefit is that it adds type definitions to incoming and outgoing fields on the client side. Working directly with JSON is kind of fucking awful. Attempts to fix it are often of an even more unpleasant "now you have two problems" sort (JSON-Schema, for example). Any well-supported standard for typing interfaces for data sent to the browser & other REST-consuming clients, even if the underlying transport remains JSON or whatever, is welcome.

Re: Hasura raises $9.9M to simplify GraphQL

#138
post #37

If GraphQL needs $9.9M to be simple enough for developers to actually use it, why was it invented?

GraphQL is mediocre. It's luke-warm mashed potatoes from a chain diner. Having used it for a number of years now, I still don't know why people recommend it beyond other people recommending it. Out of the box, it comes with no batteries included. Which explains the cottage industry that popped up to support it (Apollo, Hasura, etc.). Simply making GraphQL as efficient as bog-standard REST without involving the use of…

Hasura is more than just GraphQL. It maps GraphQL queries to single SQL statements. So you can think of it more as an ORM, but rather than mapping objects to the database it maps GraphQL statements.

The advantage of this over a traditional ORM is that by having the entire query up front it can be smarter about how it does the translation.

Regarding REST, this is very very different. With REST, you map a single "query," the REST endpoint, to an SQL statement (ideally one). But if you want some other query, you're out of luck. Either you make a new REST endpoint, or you manually call several endpoints and compose the data.

There are some dangers to the GraphQL to SQL approach, namely it's harder to guarantee performance when the client can execute arbitrary queries.

Now, GraphQL by itself, I agree it doesn't solve the hardest problems: getting the data for the query and doing it security. But something like Hasura does address those points and I do think it is an advancement over previous technologies.

Re: Hasura raises $9.9M to simplify GraphQL

#139
post #73

Earlier quoted context omitted.

GraphQL definitely has its warts, but it provides more flexibility on the API response than you'd get with ReST, so you're neither sending the whole world to keep your API space small nor adding new endpoints to handle each new client use case. But, GraphQL doesn't fundamentally change the fact that something needs to be responsible for enforcing access restrictions and talking to a database. Hasura is working to sim…

>GraphQL doesn't fundamentally change the fact that something needs to be responsible for enforcing access restrictions and talking to a database. This is what I'm struggling with when it comes to weighing the pros and cons of GraphQL. I like the SQL model, ie pushing selects and joins and such to the DB, so why not from client to host too? But when you still need to enforce access restriction and such per user per a…

Hasura and Postgraphile both use row level security for access restriction. Anyone can still execute a query, but they won't get back data they don't have access to.

Re: Hasura raises $9.9M to simplify GraphQL

#140
post #134
post #22

This is fantastic to see. First time I tried out Hasura back in late 2018 I was AMAZED. After going through multiple different stacks such as MeteorJS, Firebase, building my own REST/GraphQL API etc. Nothing really felt right. That was until I found out about Hasura. I actually had to assemble a quick meetup at the co-working space I was on (true story) to show everybody this software. Hasura Tweet: https://twitter.c…

Just tried hasura, it is amazing to get all crud graphql apis out of box. How do we add business logic ? Folks @hasura, where do we learn about haskell ? any helpful pointers much appreciated.

> How do we add business logic ?

Awkwardly. Good luck

Post reply on HN