angee.graphql.events
Payload and GraphQL event types for model change subscriptions.
ChangePayload
@dataclass(frozen=True, slots=True)
class ChangePayload()Channel-layer payload describing one model row change.
model
Django model label for the changed row.
id
Public row identifier exposed to GraphQL clients.
action
Change action: create, update, or delete.
changed_fields
Updated model fields when Django saved a partial update.
changed_values
JSON-safe changed values keyed by field name.
resource_id
REBAC resource id when it differs from the public id.
read_resource_type
Optional resource type whose read permission gates this event.
read_resource_id
Optional resource id paired with :attr:read_resource_type.
during_ingestion
Whether the change happened inside a sync ingestion context; not part of the wire message.
from_instance
@classmethod
def from_instance(cls,
instance: models.Model,
*,
action: str,
update_fields: Iterable[str] | None,
readable_fields: Iterable[str] = (),
during_ingestion: bool = False) -> ChangePayloadReturn the channel payload for a saved or deleted model instance.
from_mapping
@classmethod
def from_mapping(cls, payload: Mapping[str, Any]) -> ChangePayloadReturn a payload from its channel-layer message dictionary.
as_message
def as_message() -> dict[str, Any]Return the channel-layer dictionary representation.
resource_identifier
@property
def resource_identifier() -> strReturn the REBAC resource id, falling back to the public id.
read_resource
@property
def read_resource() -> ObjectRef | NoneReturn the model-selected event read anchor, if one was captured.
redacted
def redacted(denied_fields: set[str]) -> ChangePayloadReturn a payload with denied field-level values removed.
ChangeEvent
@strawberry.type
class ChangeEvent()Read-gated notification that one model instance changed.
from_payload
@classmethod
def from_payload(cls,
payload: ChangePayload | Mapping[str, Any]) -> ChangeEventReturn a GraphQL event from a change payload.