Skip to content

angee.graphql.actions

Shared GraphQL result type for console domain actions.

ActionResult

python
@strawberry.type
class ActionResult()

Outcome of a console domain action: a success flag and a human message.

Returned by non-CRUD action mutations (sync, test, discover, …) so the client can surface a toast and refresh the affected record.

resolve_action_target

python
def resolve_action_target(
    model: type[_ActionTarget],
    id: PublicID,
    *,
    reason: str,
    queryset: models.QuerySet[_ActionTarget] | None = None,
    select_related: tuple[str, ...] = ()
) -> _ActionTarget

Return an elevated action target addressed by one GraphQL public id.

The caller owns actor authorization, usually with field permission_classes. This helper owns the repeated action-write lookup shape: build the requested queryset, enter system_context for the row read, and raise a stable not-found error instead of leaking None into the action body.

action_target

python
@contextmanager
def action_target(
    model: type[_ActionTarget],
    id: PublicID,
    *,
    reason: str,
    queryset: models.QuerySet[_ActionTarget] | None = None,
    select_related: tuple[str, ...] = ()
) -> Iterator[_ActionTarget]

Yield a resolved action target inside the matching elevated context.

Released under the AGPL-3.0 License.