Show HN: Json2graphql – From a JSON file to Postgres-backed realtime GraphQL

wawhal | 120 points

I've tried Hasura and really liked it, but there were a few quirks that led me to another tool, but in general, the whole idea that tools like Hasura, PostgREST, pREST and PostGraphile are trying to solve are the future.

Server side frameworks are obsolete. ORMs are decrepit meta-models and log hewing busywork. Mapping an already powerful model onto one that is less powerful, eating gigabytes of ram to run JVM/Python stacks, countless rolling and restarting of processes. So many hand-rolled loops of code that could just be joins. Multiple queries to smash together two datum that could just be views all in so many thousands of lines of pointless code.

Postgres is already object-oriented, and has been for decades. It already speaks JSON and has for almost 10 years now. It can speak a number of languages, including Python and Javascript, right in the database. Postgres not only stores your data, it knows your data, the statistical distribution and selectivity of queries. No ORM system maintains this kind of optimization state when they generate SQL.

The real power of tools like Hasura is that they get out of the way. They encourage the use of views, functions, extensions, all the powerful stuff that's native to Postgres.

Who cares if it runs on MySQL? The idea is so simple that MySQL can have its own version that gets out of the way and leverages the core power of MySQL. The idea is not to have more frameworks, but to have fewer.

michelpp | 5 years ago

Hasura is a boon to productivity and keeps gaining very useful features. I really wish they had a hosted version (like netlify); I don't want to manage servers.

cpursley | 5 years ago

I was excited to see graphql-engine, but unfortunately the AGPL is a bit hard to pitch to folks in an enterprise software context.

jacques_chester | 5 years ago

Is there some way to make data available to specific users, but unavailable to others? Basically enforcing an ACL or similar?

maratd | 5 years ago

This is awesome but how do you deal with circular references?

priansh | 5 years ago

For other related automatic GraphQL tools that create realtime subscriptions to queries, check out https://github.com/brysgo/graphql-gun

I'm curious though, with Postgres, how does the realtime aspect work?

marknadal | 5 years ago

Is your code heavily dependent on Postgres or it works with any SQL store ?

dksidana | 5 years ago