🍓 Database-First GraphQL for PostgreSQL
Production-ready framework with enterprise patterns built-in. Sub-5ms responses with APQ and TurboRouter.
{
users {
id
name
posts {
title
comments {
text
}
}
}
}
SELECT jsonb_agg(
jsonb_build_object(
'id', u.id,
'name', u.name,
'posts', u.posts
)
) FROM users u
0.5-2ms cached responses. Up to 99.9% cache hit rates. Tenant-aware caching in PostgreSQL or memory. No Redis needed.
Automatically uses indexed columns for 10-100x faster queries. Seamlessly combines SQL columns with JSONB flexibility.
Zero-copy JSON passthrough from PostgreSQL to client. No Python object instantiation overhead. 4-10x faster.
Views for queries, PostgreSQL functions for mutations. ACID guarantees with structured error handling.
Native IPv4/IPv6, LTree hierarchies, DateRange. Type-aware operators no other GraphQL framework has.
Built for FastAPI. Async-first, type-safe, LLM-optimized development with dependency injection.
pip install fraiseql
import fraiseql
@fraiseql.type
class User:
id: int
name: str
@fraiseql.query
async def users(info) -> list[User]:
return await info.context.repo.fetch()
from fraiseql.fastapi import create_app
app = create_app(
database_url="postgresql://localhost/db"
)
| Scenario | Traditional ORM | FraiseQL | Improvement |
|---|---|---|---|
| Nested data (3 levels) | ~50 queries | 1 query | 50x fewer |
| Response time (1000 users) | ~800ms | ~45ms | 17x faster |
| Memory usage | ~120MB | ~25MB | 5x less |
* Performance metrics based on 3-level nested query (users → posts → comments) with PostgreSQL 14, comparing Django ORM to FraiseQL. Results vary based on data size and query complexity.
We believe in honest engineering. FraiseQL isn't for everyone:
If these are deal-breakers, check out Hasura or PostGraphile.