Write Python docstrings once. Get GraphQL schema documentation automatically in Apollo Studio, Playground, and introspection.
FraiseQL automatically extracts documentation from Python docstrings and generates comprehensive GraphQL schema descriptions. Your code comments become API documentation visible in Apollo Studio, GraphQL Playground, and any GraphQL introspection toolβwith zero configuration.
| Element | Source | Generated For | Visibility |
|---|---|---|---|
| Type Descriptions | Class docstring | GraphQL type description | Apollo Studio, Schema |
| Field Descriptions | Docstring sections | GraphQL field description | Autocomplete, Playground |
| Query Descriptions | Function docstring | GraphQL query description | API Explorer |
| Filter Operators | Type-aware generation | 35+ operators documented | IntelliSense, Docs |
from fraiseql import fraiseql
@fraiseql.type
class User:
"""
A user account in the system.
Users can create posts, comment on content, and manage their profile.
Supports multi-tenant isolation via organization_id.
Fields:
id: Unique identifier for the user
email: Primary email address (validated)
name: Full display name
created_at: Account creation timestamp
organization: Associated organization for multi-tenancy
"""
id: int
email: str
name: str
created_at: datetime
organization: "Organization"
@fraiseql.query
async def users(info) -> list[User]:
"""
Retrieve all users in the current organization.
Automatically filtered by organization_id from JWT context.
Supports pagination, filtering, and sorting.
"""
return await info.context.db.fetch_all()
# FraiseQL automatically generates:
"""
A user account in the system.
Users can create posts, comment on content, and manage
their profile. Supports multi-tenant isolation via
organization_id.
"""
type User {
"Unique identifier for the user"
id: Int!
"Primary email address (validated)"
email: String!
"Full display name"
name: String!
"Account creation timestamp"
created_at: DateTime!
"Associated organization for multi-tenancy"
organization: Organization!
}
"""
Retrieve all users in the current organization.
Automatically filtered by organization_id from JWT context.
Supports pagination, filtering, and sorting.
"""
type Query {
users: [User!]!
}
# Developers see full documentation in their tools:
# Hovering over "User" type shows:
# βββββββββββββββββββββββββββββββββββββββββ
# β User β
# βββββββββββββββββββββββββββββββββββββββββ€
# β A user account in the system. β
# β β
# β Users can create posts, comment on β
# β content, and manage their profile. β
# β Supports multi-tenant isolation via β
# β organization_id. β
# βββββββββββββββββββββββββββββββββββββββββ
# Hovering over "email" field shows:
# βββββββββββββββββββββββββββββββββββββββββ
# β email: String! β
# βββββββββββββββββββββββββββββββββββββββββ€
# β Primary email address (validated) β
# βββββββββββββββββββββββββββββββββββββββββ
# Zero manual documentation writing needed! β
Write documentation once in Python. Automatically visible in GraphQL schema and all tools.
Code and documentation never drift. Update docstring, GraphQL schema updates automatically.
No manual schema annotations. No separate documentation files. Just write normal Python docstrings.
Frontend developers get IntelliSense, autocomplete, and hover docs in Apollo Studio and VS Code.
Type-aware filter operators automatically documented. Network operators, date ranges, hierarchical queries explained.
Available since v0.9.0. 12 unit tests ensure accuracy. Battle-tested in production.
from fraiseql import fraiseql
@fraiseql.type
class Product:
"""
A product in the inventory system.
Fields:
sku: Stock Keeping Unit - unique product identifier
name: Display name shown to customers
price: Price in cents (USD). Use Decimal for precision.
stock: Current inventory count. Auto-decremented on purchase.
category: Product categorization for filtering and navigation
tags: Searchable tags for product discovery
"""
sku: str
name: str
price: int
stock: int
category: "Category"
tags: list[str]
# FraiseQL extracts each field description from "Fields:" section
# Frontend developers see detailed explanations for every field
| Approach | Maintenance | Developer Experience | Drift Risk |
|---|---|---|---|
| Manual GraphQL descriptions | β Update in 2 places | β οΈ If devs remember | β High drift risk |
| Separate docs site | β Triple maintenance | β Context switching | β Always out of date |
| No documentation | β Zero maintenance | β Poor onboarding | N/A |
| FraiseQL Auto-Docs | β Single source | β Always available | β Zero drift |
The best documentation is the documentation you don't have to maintain. FraiseQL turns your existing Python docstrings into comprehensive GraphQL schema documentation automatically.
Auto-generated documentation is available in FraiseQL v0.9.0+