thread_poll_answer
Represents a member's response to a poll in a thread activity. Poll answers allow members to vote or provide structured responses to questions posed in thread polls.
Fields
| Field | Type | Description |
|---|---|---|
id | uuid | Unique identifier for the poll answer (auto-generated) |
activityId | uuid | Reference to the thread activity (poll) |
userId | uuid | Reference to the user who submitted the answer |
choicesPoints | Int[] | Array of integer points assigned to each poll choice |
createdAt | Timestamp | When the answer was submitted (defaults to current timestamp) |
Relationships
Object Relationships
activity— The thread activity (poll) this answer belongs to
Query Examples
List Poll Answers
query GetPollAnswers($activityId: uuid!) {
thread_poll_answer(where: { activityId: { _eq: $activityId } }) {
id
activityId
userId
choicesPoints
createdAt
}
}
Mutation Examples
Submit a Poll Answer
mutation CreateThreadPollAnswer($values: thread_poll_answer_insert_input!) {
insert_thread_poll_answer_one(object: $values) {
id
activityId
userId
choicesPoints
createdAt
}
}
Update a Poll Answer
mutation UpdateThreadPollAnswer(
$id: uuid!
$values: thread_poll_answer_set_input!
) {
update_thread_poll_answer_by_pk(pk_columns: { id: $id }, _set: $values) {
id
activityId
userId
choicesPoints
createdAt
}
}
Delete Poll Answers
mutation DeleteThreadPollAnswers($activityId: uuid!) {
delete_thread_poll_answer(where: { activityId: { _eq: $activityId } }) {
returning {
id
}
}
}
Permissions
Poll answer access is controlled based on organization membership:
- View — Users can view poll answers in threads they have access to
- Create — Organization members (with Member, Admin, or Owner role) can submit answers. The
userIdis automatically set to the authenticated user - Update — Users can update their own answers only
- Delete — Users can delete their own answers. The poll activity creator can delete any answers to their poll. Organization admins and owners can delete any poll answers
Each user can submit only one answer per poll. The choicesPoints field is an
array of integers where each element represents points assigned to the
corresponding poll choice. Poll answers can be used for decision making,
scheduling, opinion gathering, and quick surveys.