"""GraphQL context for request handling.

⚠️ AUTO-GENERATED BY PRISM - DO NOT EDIT
"""


from typing import Annotated

from fastapi import Depends
from sqlalchemy.ext.asyncio import AsyncSession
from strawberry.fastapi import BaseContext

from {{ project_name }}.database import get_db


class Context(BaseContext):
    """GraphQL context passed to all resolvers."""

    def __init__(self, db: AsyncSession) -> None:
        self.db = db
        # Add user, auth info, etc. here
        # self.user = None


async def get_context(
    db: Annotated[AsyncSession, Depends(get_db)],
) -> Context:
    """Create GraphQL context from request."""
    return Context(db=db)


__all__ = ["Context", "get_context"]
