Rolebase Developers

thread_activity

Thread Activity, represents an activity or interaction within a thread. Activities include messages, polls, and references to other entities, forming the conversation content of a thread.

Fields

FieldTypeDescription
iduuidUnique identifier for the activity (auto-generated)
threadIduuidReference to the parent thread
userIduuidReference to the user who created the activity
memberIduuidReference to the member who created the activity
typeThread_Activity_Type_EnumType of activity: Message, Poll, Proposal, ProposalEvent, Thread, Meeting, Task, Decision, or MeetingNote
dataJSONActivity content (format depends on type)
createdAttimestamptzWhen the activity was created (defaults to current timestamp)
archivedAttimestamptzWhen the activity was archived; null if active
refThreadIduuidOptional reference to another thread
refMeetingIduuidOptional reference to a meeting
refTaskIduuidOptional reference to a task
refDecisionIduuidOptional reference to a decision

Activity Types

The type field accepts the following enum values:

  • Message — Text message or rich content
  • Poll — Poll for gathering opinions
  • Proposal — Governance proposal with prepared org chart changes
  • ProposalEvent — Proposal event (resolution, cancellation, vote reminder)
  • Thread — Reference to another thread
  • Meeting — Reference to a meeting
  • Task — Reference to a task
  • Decision — Reference to a decision
  • MeetingNote — Note created during a meeting

Relationships

Object Relationships

  • thread — The thread this activity belongs to
  • user — The user who created the activity
  • refThread — Optional referenced thread
  • refMeeting — Optional referenced meeting
  • refTask — Optional referenced task
  • refDecision — Optional referenced decision

Array Relationships

Query Examples

List Thread Activities

query GetThreadActivities($threadId: uuid!) {
thread_activity(
where: { threadId: { _eq: $threadId } }
order_by: { createdAt: asc }
) {
id
threadId
userId
createdAt
type
data
reactions {
id
shortcode
userId
}
refThread {
id
title
}
refMeeting {
id
title
}
refTask {
id
title
}
refDecision {
id
title
}
}
}

Mutation Examples

Create a Thread Activity

mutation CreateThreadActivity {
insert_thread_activity_one(
object: {
threadId: "123e4567-e89b-12d3-a456-426614174000"
userId: "123e4567-e89b-12d3-a456-426614174001"
type: Message
data: { message: "Hello team!" }
}
) {
id
type
data
createdAt
}
}

Update a Thread Activity

mutation UpdateThreadActivity {
update_thread_activity_by_pk(
pk_columns: { id: "123e4567-e89b-12d3-a456-426614174002" }
_set: { data: { message: "Updated message" } }
) {
id
data
createdAt
}
}

Permissions

Thread activity access is controlled through Hasura permissions and row-level security:

  • View — Users can view activities in threads they have access to
  • Create — Users can create new activities in threads they have access to
  • Update — Users can update their own activities. MeetingNote activities can also be updated by users with access to the thread
  • Delete — Users can delete their own activities. Organization admins and owners can delete any activity

The data field structure varies based on the activity type. Activities are ordered chronologically within a thread and support reactions with aggregation. The reference fields allow activities to link to other entities for context.