"""GraphQL types for {{ model_name }}.

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

{{ imports }}


@strawberry.type(description="{{ description }}")
class {{ model_name }}Type:
    """GraphQL type for {{ model_name }}."""

{{ type_fields }}
{% if relationship_fields %}

    # Private fields for relationship lazy loading
{{ relationship_fields }}
{% endif %}
{% if relationship_resolvers %}

    # Relationship resolvers
{{ relationship_resolvers }}
{% endif %}


@strawberry.input(description="Input for creating a {{ model_name }}")
class {{ model_name }}Input:
    """Input type for creating {{ model_name }}."""

{{ input_fields }}


@strawberry.input(description="Input for updating a {{ model_name }}")
class {{ model_name }}UpdateInput:
    """Input type for updating {{ model_name }}. All fields are optional."""

{{ update_fields }}


def {{ snake_name }}_from_model(obj: Any) -> {{ model_name }}Type:
    """Convert a SQLAlchemy model to GraphQL type."""
    return {{ model_name }}Type(
        id=obj.id,
{{ conversion_fields }}
    )


__all__ = ["{{ model_name }}Type", "{{ model_name }}Input", "{{ model_name }}UpdateInput", "{{ snake_name }}_from_model"]
