πŸ“ Auto-Generated Documentation

Write Python docstrings once. Get GraphQL schema documentation automatically in Apollo Studio, Playground, and introspection.

What is Auto-Generated Documentation?

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

How It Works

1. Write Python Docstrings

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()

2. GraphQL Schema (Auto-Generated)

# 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!]!
}

3. Apollo Studio / Playground

# 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! βœ…

Key Benefits

πŸ“š

Single Source of Truth

Write documentation once in Python. Automatically visible in GraphQL schema and all tools.

πŸ”„

Always in Sync

Code and documentation never drift. Update docstring, GraphQL schema updates automatically.

🎯

Zero Configuration

No manual schema annotations. No separate documentation files. Just write normal Python docstrings.

πŸ› οΈ

Better Developer Experience

Frontend developers get IntelliSense, autocomplete, and hover docs in Apollo Studio and VS Code.

πŸ“–

35+ Filter Operators Documented

Type-aware filter operators automatically documented. Network operators, date ranges, hierarchical queries explained.

βœ…

Production-Ready

Available since v0.9.0. 12 unit tests ensure accuracy. Battle-tested in production.

Advanced: Field-Level Documentation

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

Docstring Parsing Rules

Perfect For

Why This Matters

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.

Ready for Self-Documenting APIs?

Auto-generated documentation is available in FraiseQL v0.9.0+