angee.graphql.introspection
Strawberry and strawberry-django introspection helpers.
surface_name
def surface_name(surface: object) -> strReturn a readable name for a Strawberry surface.
surface_field_names
def surface_field_names(surface: object) -> tuple[str, ...]Return field names declared by a Strawberry type.
django_model
def django_model(node: type) -> type[models.Model]Return the Django model backing a strawberry-django type.
is_to_one_relation
def is_to_one_relation(field: models.Field[Any, Any]) -> boolReturn whether field is a forward to-one relation.
is_to_many_relation
def is_to_many_relation(field: models.Field[Any, Any]) -> boolReturn whether field represents a to-many relation path.
FieldPathError
class FieldPathError(Exception)A __/.-separated relation path could not resolve to a leaf to-one field.
Carries the failure mode so callers translate it to their own wording: to_many marks a rejected to-many segment, unknown covers a missing field or a path that walks past a non-relation leaf.
require_field_for_path
def require_field_for_path(model: type[models.Model],
path: str) -> models.Field[Any, Any]Resolve a __/.-separated relation path to a leaf to-one field.
Walks each segment with _meta.get_field, following the forward relation at each step, and raises :class:FieldPathError (to_many or unknown) so each caller renders its own diagnostic message.