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

PostGraphile compiles GraphQL directly to SQL. The SQL is "custom" in that it's specific to the GraphQL operation, though naturally it does follow rules. For example, Hasura does the same thing, and among the rules that it follows is that it uses `LEFT LATERAL JOIN` between tables (at least, on PostgreSQL). Full disclosure, I work for Hasura, so I'm not super familiar with the style of SQL PostGraphile generates but one thing you can do is just have PostGraphile report back the generated SQL for inspection:

https://www.graphile.org/postgraphile/debugging/#via-postgra...



postgraphile v5 has significantly improved query generation (https://postgraphile.org/postgraphile/next/) since moving to grafast (https://grafast.org/grafast/)


Nice!


> PostGraphile compiles GraphQL directly to SQL. The SQL is "custom" in that it's specific to the GraphQL operation

Yes, that's why I said GraphQL and -corresponding- SQL, I was hoping to find something that showed me the SQL for each of half a dozen or a dozen examples ... though the debug option there will let me point the out-of-the-box CLI at a pre-existing database and have a look at as many examples as I like, so that's pretty close to what I was looking for.

Would also be interested to see a bunch of examples of what Hasura generates if you have those to hand (I'm going to poke through the Hasura Community Edition docs but if you have the specific FM to R handy ... :)


Ahh, I see. Yeah, I suppose some examples in the docs would be nice.

Anyway, here's an example with Hasura:

https://gist.github.com/dventimihasura/b3f3c9e7ef1442d8e7f16...




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

Search: