You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix: strawchemy fields on plain strawberry types fail with AttributeError instead of StrawchemyFieldError #391
A strawchemy.field whose type is a plain strawberry type (not a strawchemy type) is not rejected at definition, and then fails with an unrelated error:
Field
Error
plain: list[Plain] = strawchemy.field() (root, no resolver)
AttributeError: __dto_model__ at query time, from dto_model_from_type when get_result builds the repository
AttributeError: type object 'Plain' has no attribute '__dto_model__' at definition, from the default_order_by block of StrawchemyField._validate_type
@strawberry.typeclassPlain:
name: str
The query hook model check (#388) is skipped for these fields too, since it only runs on strawchemy types.
Expected
StrawchemyField._validate_type (src/strawchemy/schema/field.py) raises StrawchemyFieldError at definition when a field that needs a strawchemy type (root field without resolver, default_order_by) has a plain strawberry type.
changed the title [-]fix: strawchemy fields on plain strawberry types fail with AttributeError instead of StrawchemyFieldError[/-][+]fix: strawchemy fields on plain strawberry types fail with `AttributeError` instead of `StrawchemyFieldError`[/+]on Sep 28, 2026
Activity
[-]fix: strawchemy fields on plain strawberry types fail with AttributeError instead of StrawchemyFieldError[/-][+]fix: strawchemy fields on plain strawberry types fail with `AttributeError` instead of `StrawchemyFieldError`[/+]fix(#391): reject strawchemy fields on plain strawberry types at defi…