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.
from_instance
@classmethod
def from_instance(cls, instance: models.Model, *, action: str,
update_fields: Iterable[str] | None) -> 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.
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.