angee.graphql.ids
GraphQL public-id primitives for Angee schemas.
PublicID
GraphQL ID scalar carrying an Angee public id, usually a model sqid.
public_id_value
python
def public_id_value(value: Any) -> strReturn value as the raw public id used at GraphQL boundaries.
to_public_id
python
def to_public_id(model: type[models.Model], fk_id: Any) -> PublicID | NoneProject a model foreign-key value to its public id, or None when unset.
require_public_id
python
def require_public_id(model: type[models.Model], fk_id: Any) -> PublicIDProject a required (non-null) model foreign-key value to its public id.
optional_public_id
python
def optional_public_id(value: str | None) -> PublicID | NoneWrap an optional already-resolved public id string as a GraphQL ID.
instance_for_id
python
def instance_for_id(
model: type[_ModelT],
value: Any,
*,
queryset: models.QuerySet[_ModelT] | None = None) -> _ModelT | NoneReturn model row addressed by a GraphQL public id.
require_instance_for_id
python
def require_instance_for_id(
model: type[_ModelT],
value: Any,
*,
queryset: models.QuerySet[_ModelT] | None = None) -> _ModelTReturn the row for value or raise a stable not-found error.
assert_unique_sqid_prefixes
python
def assert_unique_sqid_prefixes(types: tuple[object, ...]) -> NoneFail schema build when two public model owners declare the same sqid prefix.