PostGraphile

Automatic GraphQL API generation from PostgreSQL database schema. Reflects PostgreSQL tables, views, functions, and relationships into a fully-featured GraphQL API. Supports filtering, pagination, ordering, mutations (CRUD), subscriptions (via PostgreSQL LISTEN/NOTIFY), and custom business logic via PostgreSQL functions. Uses PostgreSQL row-level security (RLS) for authorization. 'Your database, already an API.'

Evaluated Mar 07, 2026 (0d ago) v4.x / 5.x (Grafast)
Homepage ↗ Repo ↗ Developer Tools graphql postgresql auto-generated relay subscriptions pgmq introspection node
⚙ Agent Friendliness
61
/ 100
Can an agent use this?
🔒 Security
90
/ 100
Is it safe for agents?
⚡ Reliability
80
/ 100
Does it work consistently?

Score Breakdown

⚙ Agent Friendliness

MCP Quality
--
Documentation
83
Error Messages
78
Auth Simplicity
80
Rate Limits
85

🔒 Security

TLS Enforcement
95
Auth Strength
90
Scope Granularity
88
Dep. Hygiene
87
Secret Handling
88

Database-level authorization via PostgreSQL RLS is a strong security model. JWT auth maps claims to PostgreSQL session variables. MIT core. Defense in depth via database security.

⚡ Reliability

Uptime/SLA
83
Version Stability
80
Breaking Changes
75
Error Recovery
80
AF Security Reliability

Best When

Your API closely mirrors your PostgreSQL schema and you want automatic GraphQL generation with PostgreSQL's full feature set (RLS, functions, views).

Avoid When

Your API has complex multi-system business logic or you need a non-PostgreSQL database — use Hasura for multi-DB or build custom resolvers.

Use Cases

  • Generate a complete GraphQL API from an existing PostgreSQL schema without writing resolver code
  • Expose PostgreSQL row-level security policies to GraphQL for database-level authorization that's automatically enforced
  • Build real-time subscriptions on PostgreSQL data changes using PostGraphile's LISTEN/NOTIFY integration
  • Extend auto-generated API with custom PostgreSQL functions that appear as GraphQL mutations or queries
  • Rapid prototyping of GraphQL APIs where the schema is driven by the database model without boilerplate

Not For

  • Non-PostgreSQL databases — PostGraphile is PostgreSQL-specific; use Hasura (multi-DB) or custom resolvers for other databases
  • APIs that need complex business logic beyond database operations — PostGraphile's logic lives in PostgreSQL functions
  • Teams preferring code-first GraphQL — PostGraphile is database-first; type-graphql or Pothos offer code-first approaches

Interface

REST API
No
GraphQL
Yes
gRPC
No
MCP Server
No
SDK
Yes
Webhooks
No

Authentication

Methods: bearer_token api_key
OAuth: No Scopes: No

JWT-based authentication that sets PostgreSQL session variables. Row-level security enforced at database level. JWT claims become PostgreSQL settings (e.g., request.jwt.claim.user_id).

Pricing

Model: open_source
Free tier: Yes
Requires CC: No

MIT licensed core. Pro plugins available for purchase. Core PostGraphile is free and powerful.

Agent Metadata

Pagination
cursor
Idempotent
Full
Retry Guidance
Not documented

Known Gotchas

  • PostGraphile introspects the database schema — schema changes require PostGraphile restart or watch mode for automatic schema updates
  • Row-level security must be enabled on PostgreSQL tables explicitly — without RLS, PostGraphile exposes all rows to all authenticated users
  • JWT claims must match PostgreSQL function signatures exactly — claim names and types must align with what PostgreSQL RLS policies expect
  • N+1 query problem is solved via Dataloader — but complex nested queries may still generate many database round-trips without careful schema design
  • PostGraphile v5 (Grafast) has different plugin/middleware API than v4 — migration guide required for v4 setups
  • Custom SQL functions must follow PostGraphile's naming conventions to appear in GraphQL schema automatically

Alternatives

Full Evaluation Report

Comprehensive deep-dive: security analysis, reliability audit, agent experience review, cost modeling, competitive positioning, and improvement roadmap for PostGraphile.

AI-powered analysis · PDF + markdown · Delivered within 30 minutes

$99

Package Brief

Quick verdict, integration guide, cost projections, gotchas with workarounds, and alternatives comparison.

Delivered within 10 minutes

$3

Score Monitoring

Get alerted when this package's AF, security, or reliability scores change significantly. Stay ahead of regressions.

Continuous monitoring

$3/mo

Scores are editorial opinions as of 2026-03-07.

6470
Packages Evaluated
26150
Need Evaluation
173
Need Re-evaluation
Community Powered