Live data from Hacker News

GraphQL is now available on Supabase

supabase.com

41–49 of 49 posts

Re: GraphQL is now available on Supabase

#41

Hi all, this sounds very cool. How does pg_graphql compare to Postgraphile? https://github.com/graphile/postgraphile (besides I guess running in the DB with PLpgSQL instead of as a NodeJS server) Did you think about integrating Postgraphile with the Supabase ecosystem or have specific limitations with it? Thanks!

> How does pg_graphql compare to Postgraphile?

PostGraphile is very close to pg_graphql in goals. It was a big help during development to be able to reference their implementation.

> Did you think about integrating Postgraphile with the Supabase ecosystem..?

For sure! We wrote a blog post about why we chose to implement the reflection engine as a Postgres extension here https://supabase.com/blog/2021/12/03/pg-graphql w/ a direct comparison against Postgraphile and Hasura.

The summary is that we tried out Graphile and Hasura and found that they were both very workable options. We had a few other requirements that led us to the extension instead:

- An extremely minimal memory footprint

- Performance scales with the DB

- 100% security and visibility interop with PostgREST (powers Supabase REST API)

The blog post's "motivation" has some more specifics if you're interested!

Re: GraphQL is now available on Supabase

#42

heyo, thanks for the ping I'm the dev lead on pg_graphql. Happy to answer any questions!

It's impressive that the entire thing is in pl/pgsql (apart from parsing). Have you considered any other implementation strategies (C native extension, any other pl/* or maybe running an out of PostgreSQL process which does GraphQL to SQL compilation)?

Yes! We've been exploring https://github.com/tcdi/pgx internally so we'd be able to re-work the hotspots in rust.

We haven't decided to go that route yet but its been incredibly easy to work with & I'm psyched about what options it could open up like:

- Stateless requests (no schema cache)

- Subscriptions (via a background worker)

Re: GraphQL is now available on Supabase

#43

heyo, thanks for the ping I'm the dev lead on pg_graphql. Happy to answer any questions!

Excellent work! Postgraphile uses a naming convention for postgres functions to extend the GraphQL schema [1]. Do you have any plans to support a similar mechanism in pg_graphql? [1]: https://www.graphile.org/postgraphile/functions/

Thanks!

Yes, we currently support extending table types via functions using a naming convention. The docs for that feature are available here https://supabase.github.io/pg_graphql/computed_fields/#exten...

It's also on the near-term roadmap to implement custom mutations from user defined functions, similar to postgraphile

Re: GraphQL is now available on Supabase

#44

heyo, thanks for the ping I'm the dev lead on pg_graphql. Happy to answer any questions!

Any plans to expose RPC functions inside of GraphQL?

Yes, its on the roadmap to implement custom mutations reflected from user defined functions

Re: GraphQL is now available on Supabase

#46

Earlier quoted context omitted.

Excellent work! Postgraphile uses a naming convention for postgres functions to extend the GraphQL schema [1]. Do you have any plans to support a similar mechanism in pg_graphql? [1]: https://www.graphile.org/postgraphile/functions/

Thanks! Yes, we currently support extending table types via functions using a naming convention. The docs for that feature are available here https://supabase.github.io/pg_graphql/computed_fields/#exten... It's also on the near-term roadmap to implement custom mutations from user defined functions, similar to postgraphile

Excellent - thanks!

Re: GraphQL is now available on Supabase

#47
post #29
post #11

Earlier quoted context omitted.

that's great, but what if I want to add a role to my user to do something like send an email with an extended schema (when that lands). What if I'm not familiar with "row level permissions" and I have a SaSS app where different users can access different rows based on column content? Scenarios like those are where the docs fall short. PLEASE think like new users and not like seasoned engineers with prior experience w…

Supabase's row level security is just postgres row level security, it's not proprietary to Supabase. Postgres documentation, blog posts etc on RLS will apply to Supabase too.

I get this, and I've been using postgres for a long time, so I should get this. My point is that the barrier for entry is very high. Most folks that have experience with GraphQL and not intimate knowledge of Postgres security/access are going to struggle with this. It's much different than say, Postgraphile or Asura - both of which have a much lower barrier for entry. Folks are naturally going to compare. I've been following their GraphQL extension since its development announcement and I think this will end up being the better GraphQL product in the long term. I want Supabase to be a world-class product because I'm a fan, and that means world-class documentation.

Re: GraphQL is now available on Supabase

#48
post #24

Earlier quoted context omitted.

EdgeDB [1] has indeed a rich GraphQL layer, but it's a very different project. While it also builds on top of Postgres, EdgeDB replaces the entire relational database front-end. EdgeDB features a SQL replacement language called EdgeQL (analytical capabilities of SQL married with deep-fetching in GraphQL), a higher-level data model (tables -> object types), integrated migrations engine, a custom protocol with great pe…

Are there any plans to provide a Java client for EdgeDB?

Eventually yes, but we aren't working on it right now.

Re: GraphQL is now available on Supabase

#49
post #47
post #29

Earlier quoted context omitted.

Supabase's row level security is just postgres row level security, it's not proprietary to Supabase. Postgres documentation, blog posts etc on RLS will apply to Supabase too.

I get this, and I've been using postgres for a long time, so I should get this. My point is that the barrier for entry is very high. Most folks that have experience with GraphQL and not intimate knowledge of Postgres security/access are going to struggle with this. It's much different than say, Postgraphile or Asura - both of which have a much lower barrier for entry. Folks are naturally going to compare. I've been f…

You're definitely not wrong. I think Supabase will get there ultimately. But being a startup and presumably a small team, I think it's ok for them to lean on "Supabase is basically postgres as a service so postgres docs can fill the void for now".

And just for the record I'm not affiliated with Supabase, I just use it on a side project and quite like it.

Post reply on HN