Build your first FraiseQL API in 5 minutes
3.13+
Modern type system features
13+
JSONB, Functions, Views
Basic SQL
PostgreSQL Views & Functions
# Using pip
pip install fraiseql
# Or with uv (recommended for faster installs)
uv pip install fraiseql
# Verify installation
python -c "import fraiseql; print(f'FraiseQL {fraiseql.__version__}')"
💡 Tip: The pip install fraiseql command always installs the latest stable version.
Check PyPI for version history.
Create a Python class with type hints. FraiseQL automatically generates the GraphQL schema.
from datetime import datetime
import fraiseql
@fraiseql.type
class User:
"""A user account with authentication and profile information."""
id: int
email: fraiseql.EmailAddress
name: str
created_at: datetime
FraiseQL uses database views to query data. Views return JSONB objects that map to your GraphQL types.
CREATE VIEW v_users AS
SELECT jsonb_build_object(
'id', pk_user,
'email', email,
'name', name,
'createdAt', created_at
) AS data
FROM tb_users;
💡 Note: FraiseQL automatically serializes timestamptz to ISO 8601 format.
No need for ::text casting!
Use the @fraiseql.query decorator to expose a query resolver.
import fraiseql
from .types import User
@fraiseql.query
async def users(info) -> list[User]:
"""Get all users with their profile information."""
repo = info.context["repo"]
return await repo.find("v_users")
FraiseQL includes a built-in development server with hot reload.
fraiseql dev
# Server starts at http://localhost:8000/graphql
Open http://localhost:8000/graphql in your browser and run:
{
users {
id
name
email
}
}
Learn how to create, update, and delete data using PostgreSQL Functions
Get sub-5ms cached responses with Automatic Persisted Queries
Generate mutations 10x faster with Claude or Copilot
Explore advanced features, authentication, and deployment guides
FraiseQL is production-ready. Check the status page for feature maturity and deployment guidance.