Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

small edits for pggql

Copple98e163b010e9
diff --git a/www/_blog/2021-12-03-pg-graphql.mdx b/www/_blog/2021-12-03-pg-graphql.mdx
index d8727cc9574..21b9e6bc2d2 100644
--- a/www/_blog/2021-12-03-pg-graphql.mdx
+++ b/www/_blog/2021-12-03-pg-graphql.mdx
@@ -14,7 +14,7 @@ date: '2021-12-03'
toc_depth: 3
---
-Today we're open sourcing [pg_graphql](https://github.com/supabase/pg_graphql), a work-in-progress native PostgreSQL extension adding GraphQL support. The extension keeps schema generation, query parsing, and resolvers all neatly contained on your database server requiring no external services.
+Today we're open sourcing [`pg_graphql`](https://github.com/supabase/pg_graphql), a work-in-progress native PostgreSQL extension adding GraphQL support. The extension keeps schema generation, query parsing, and resolvers all neatly contained on your database server requiring no external services.
`pg_graphql` inspects an existing PostgreSQL schema and reflects a GraphQL schema with resolvers that are:
@@ -31,7 +31,7 @@ Interested? You're [3 commands away](https://supabase.github.io/pg_graphql/quick
The Supabase stack is centered around PostgreSQL as the single source of truth. All data, configuration, and security are housed in the database so any GraphQL solution needed to be equivalently SQL-centric.
-With that in mind, we took a look at the landscape and considered two excellent technologies, Graphile, and Hasura.
+With that in mind, we took a look at the landscape and considered two excellent technologies, [Graphile](https://www.graphile.org/postgraphile/), and [Hasura](https://hasura.io/).
| Requirements | Graphile | Hasura |
|--------------------------|----------|--------|
@@ -43,7 +43,7 @@ With that in mind, we took a look at the landscape and considered two excellent
We found both options to be largely viable for the core feature set.
-Which left us with one final hang-up: We host free-tier projects on VMs with 1 GB of memory. After tallying the resources reserved for PostgreSQL, PostgREST, Kong, GoTrue, and a handful of smaller services, we were left with a total memory budget of ... 0 MB 😬. Unsurprisingly, our pathological memory target disqualified any option that required launching another process in those VMs.
+Which left us with one final hang-up: we host free-tier projects on VMs with 1 GB of memory. After tallying the resources reserved for PostgreSQL, PostgREST, Kong, GoTrue, and a handful of smaller services, we were left with a total memory budget of ... 0 MB 😬. Unsurprisingly, our pathological memory target disqualified any option that required launching another process in those VMs.
For that reason, we decided to invest in a lightweight alternative that runs in the database, and can be exposed over HTTP using the existing [PostgREST](https://supabase.com/docs/guides/api) deployments' [RPC functionality.](https://postgrest.org/en/v8.0/api.html#stored-procedures)
@@ -53,7 +53,7 @@ By our most conservative estimate, that reduces the platform's memory requiremen
As a native PostgreSQL extension, `pg_graphl` is written in a combination of C and SQL. Each GraphQL query is parsed, validated, and transpiled to SQL, all within the database.
-Each GraphQL request is resolved by a single SQL statement. That SQL statement aggregates requested data as a JSON document to return to the caller. This approach results blazing fast response times, avoids the [N+1 query problem](https://medium.com/the-marcy-lab-school/what-is-the-n-1-problem-in-graphql-dd4921cb3c1a), and hits the theoretical minimum achievable network IO of any GraphQL to SQL resolver. No special permissions are required for the PostgreSQL role executing queries so pg_graphql is fully compatible with your existing r[ow level security policies](https://www.postgresql.org/docs/13/ddl-rowsecurity.html).
+Each GraphQL request is resolved by a single SQL statement. That SQL statement aggregates requested data as a JSON document to return to the caller. This approach results blazing fast response times, avoids the [N+1 query problem](https://medium.com/the-marcy-lab-school/what-is-the-n-1-problem-in-graphql-dd4921cb3c1a), and hits the theoretical minimum achievable network IO of any GraphQL to SQL resolver. No special permissions are required for the PostgreSQL role executing queries so `pg_graphql` is fully compatible with your existing [row level security policies](/docs/guides/auth/row-level-security).
Embedding the GraphQL server directly in the database enables us leverage PostgreSQL's built-in solutions for common challenges: