Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.
TypeScript agentaiai-agentsall-in-onecrmcrm-systememaillinearmcpmessagingnotesnotionofficerustslackslack-alternativestartupstartup-toolstypescriptworkspace
graphql_activity
What it is
Backs the Activity feed feature across the app: a GraphQL adapter exposing
three read surfaces over the activity_events log — the viewer's feed, a
trailing-year overview, a per-entity activity edge (batched via
DataLoader) — plus database/form timelines and a realtime subscription.
Start here
src/lib.rs: read the crate doc — it lists exactly which resolver answers which surface and why entities carry onlyentityType/entityIdreferences (clients resolve names from their Soup cache).src/loaders.rs:EntityActivityLoader— the batched per-entity edge; touch this when activity needs to appear on a new Soup entity type.src/feed.rs/src/overview.rs: the viewer feed and yearly aggregate. The feed'sscopeinput picks the viewer's own activity (MINE) or their teammates' (TEAM).TEAMrows are filtered to entities shared with the viewer in storage (activity'steammate_feed); its pages can come up short, or empty, with a cursor, and clients keep paging.src/timeline.rs: by-id, access-checked timelines for databases/forms (not Soup items, so not loader-batched).src/subscriptions.rs: the realtimeactivityUpdatessubscription.
Scope
- Owns: GraphQL objects/resolvers over activity; not the event log itself →
crates/activity.
Boundaries
- Depends on:
activity(realtime feature),entity_access,graphql_common. - Used by:
complete_graph.
Recipes
- Add activity to a new Soup entity:
src/loaders.rs(reader) →crate::activityport implementation for that entity → wire the edge on the entity's GraphQL object incomplete_graph.
Checks
cargo test -p graphql_activity.
Related
- Rules:
.agents/rules/rust/architecture.md