/plushcap/analysis/supabase/pg_graphql-a-graphql-extension-for-postgresql

pg_graphql: A GraphQL extension for PostgreSQL

What's this blog post about?

Today, we are open-sourcing pg_graphql, a native PostgreSQL extension that adds GraphQL support to the database server without requiring any external services. This extension inspects an existing PostgreSQL schema and reflects a GraphQL schema with resolvers that are performant, always up-to-date, compliant with best practices, serverless, and open source. The Supabase stack is centered around PostgreSQL as the single source of truth, so pg_graphql was designed to be SQL-centric. It runs in the database and can be exposed over HTTP using existing PostgREST deployments' RPC functionality. This approach reduces memory requirements by 525 TB/hours every month, saving both money and resources. As a native PostgreSQL extension, pg_graphql is written in C and SQL, with each GraphQL query parsed, validated, and transpiled to SQL within the database. It benefits from PostgreSQL's built-in solutions for common challenges like caching, errors, bad data, authorization, and strong ACID guarantees.

Company
Supabase

Date published
Dec. 3, 2021

Author(s)
Oliver Rice

Word count
925

Language
English

Hacker News points
431


By Matt Makai. 2021-2024.