pg_graphql
pg_graphql : Add in-database GraphQL support
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 2740 | pg_graphql | pg_graphql | 1.6.1 |
FEAT | Apache-2.0 | Rust |
| Attribute | Has Binary | Has Library | Need Load | Has DDL | Relocatable | Trusted |
|---|---|---|---|---|---|---|
| --s-d-- | No | Yes | No | Yes | no | no |
| Relationships | |
|---|---|
| Schemas | graphql |
| See Also | omni_rest documentdb pg_net http pg_jsonschema pgjwt pg_session_jwt |
Packages
| Type | Repo | Version | PG Major Compatibility | Package Pattern | Dependencies |
|---|---|---|---|---|---|
| EXT | PIGSTY | 1.6.1 |
18 17 16 15 14 | pg_graphql |
- |
| RPM | PIGSTY | 1.6.1 |
18 17 16 15 14 | pg_graphql_$v |
- |
| DEB | PIGSTY | 1.6.1 |
18 17 16 15 14 | postgresql-$v-pg-graphql |
- |
| Linux / PG | PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|---|
| el8.x86_64 | PIGSTY 1.6.1 | PIGSTY 1.6.1 | PIGSTY 1.6.1 | PIGSTY 1.6.1 | PIGSTY 1.6.1 |
| el8.aarch64 | PIGSTY 1.6.1 | PIGSTY 1.6.1 | PIGSTY 1.6.1 | PIGSTY 1.6.1 | PIGSTY 1.6.1 |
| el9.x86_64 | PIGSTY 1.6.1 | PIGSTY 1.6.1 | PIGSTY 1.6.1 | PIGSTY 1.6.1 | PIGSTY 1.6.1 |
| el9.aarch64 | PIGSTY 1.6.1 | PIGSTY 1.6.1 | PIGSTY 1.6.1 | PIGSTY 1.6.1 | PIGSTY 1.6.1 |
| el10.x86_64 | PIGSTY 1.6.1 | PIGSTY 1.6.1 | PIGSTY 1.6.1 | PIGSTY 1.6.1 | PIGSTY 1.6.1 |
| el10.aarch64 | PIGSTY 1.6.1 | PIGSTY 1.6.1 | PIGSTY 1.6.1 | PIGSTY 1.6.1 | PIGSTY 1.6.1 |
| d12.x86_64 | PIGSTY 1.6.1 | PIGSTY 1.6.1 | PIGSTY 1.6.1 | PIGSTY 1.6.1 | PIGSTY 1.6.1 |
| d12.aarch64 | PIGSTY 1.6.1 | PIGSTY 1.6.1 | PIGSTY 1.6.1 | PIGSTY 1.6.1 | PIGSTY 1.6.1 |
| d13.x86_64 | PIGSTY 1.6.1 | PIGSTY 1.6.1 | PIGSTY 1.6.1 | PIGSTY 1.6.1 | PIGSTY 1.6.1 |
| d13.aarch64 | PIGSTY 1.6.1 | PIGSTY 1.6.1 | PIGSTY 1.6.1 | PIGSTY 1.6.1 | PIGSTY 1.6.1 |
| u22.x86_64 | PIGSTY 1.6.1 | PIGSTY 1.6.1 | PIGSTY 1.6.1 | PIGSTY 1.6.1 | PIGSTY 1.6.1 |
| u22.aarch64 | PIGSTY 1.6.1 | PIGSTY 1.6.1 | PIGSTY 1.6.1 | PIGSTY 1.6.1 | PIGSTY 1.6.1 |
| u24.x86_64 | PIGSTY 1.6.1 | PIGSTY 1.6.1 | PIGSTY 1.6.1 | PIGSTY 1.6.1 | PIGSTY 1.6.1 |
| u24.aarch64 | PIGSTY 1.6.1 | PIGSTY 1.6.1 | PIGSTY 1.6.1 | PIGSTY 1.6.1 | PIGSTY 1.6.1 |
| u26.x86_64 | PIGSTY 1.6.1 | PIGSTY 1.6.1 | PIGSTY 1.6.1 | PIGSTY 1.6.1 | PIGSTY 1.6.1 |
| u26.aarch64 | PIGSTY 1.6.1 | PIGSTY 1.6.1 | PIGSTY 1.6.1 | PIGSTY 1.6.1 | PIGSTY 1.6.1 |
Source
github.com/supabase/pg_graphql
pg_graphql-1.6.1.tar.gz
Install
Make sure PGDG and PIGSTY repo available:
Install this extension with pig:
Create this extension with:
Usage
Sources: README, documentation, v1.6.1 release
pg_graphql reflects a GraphQL schema from your existing SQL schema, enabling GraphQL queries directly inside PostgreSQL without additional servers or middleware.
Schema Reflection
Tables, foreign keys, and enums are automatically mapped to GraphQL types:
This schema automatically generates GraphQL types (Account, Blog, BlogPost) with relationships derived from foreign keys.
Name Inflection
Enable automatic snake_case to camelCase/PascalCase conversion:
Querying
Execute a GraphQL query via the graphql.resolve function:
Features
- Table queries appear as pageable collections on the root
Querytype - Foreign key relationships create nested query fields automatically
- Mutations support bulk insert, update, and delete
- Filtering, ordering, and pagination are built in
- PostgreSQL Row-Level Security (RLS) policies are respected
Version Notes
pg_graphql 1.6.1 fixes double NON_NULL wrapping in byPk argument types that could break GraphiQL introspection, fixes mixed introspection/data queries returning partial results incorrectly, and updates documentation around introspection opt-in notices.