Polls architecture and implementation #5207
Replies: 3 comments 5 replies
-
Thanks for putting this together, @BartoszJarocki 🙌
Yes, it should work the same way it currently does for tasks and comments 👍
If the user has not submitted the poll (by pressing the
🤔 I did not think of this one. I wonder if the bring any value to a poll? Do you have any strong opinions? My gut tells me to go without reactions and add them later if we learn that we need them. |
Beta Was this translation helpful? Give feedback.
-
schema looks good! couple thoughts:
For the mutations, I'd suggest:
in the past i combined vote/unvote as a single mutation because aside from the query itself the logic is pretty similar (see https://github.com/ParabolInc/parabol/blob/b6c409332cd08bb48dbd505e10bcbe5ef1ea1cab/packages/server/graphql/mutations/voteForReflectionGroup.ts) but if it looks better as 2 mutations that's AOK the big question in my mind is what should the other participants see while someone is creating a poll? they see "X is creating a poll" but do they see a wireframe? do they see options as they get added? if we stick with the start button, then we'll have to keep a bunch of local state until everything looks good & they hit "start". if we get rid of the start button, we can call create poll immediately & other team members see it being built in real time. this is similar to how tasks work today @enriquesanchez curious for your thoughts |
Beta Was this translation helpful? Give feedback.
-
One more question, if user deletes a poll, are we doing hard or soft? |
Beta Was this translation helpful? Give feedback.
-
Before I start writing code I'd love to get some feedback about things that are not clear to me.
Polls epic: #5147
Polls design: https://www.figma.com/file/D25gVH1t2alUiOdYNs5Owo/Multiple-content-input-types?node-id=518%3A19375
Design
I have a few questions about the design
Database schema
When I thought about how the data model should look like I considered the following
I'm not sure about the indexes and in general about the data model. I think this covers all the use cases but I'd appreciate it if someone can take a look 🙏 .
BTW. I've also played with a data modeling tool: https://dbdiagram.io/d/60f97115b7279e4123365a07 Maybe it'd be useful to have our schema there.
Backend
Similar to
Comment
andTask
,Poll
should implement theThreadable
interface.In the same manner, we should have a basic CRUD:
AddPollMutation
EditPollMutation
DeletePollMutation
AddPollVoteMutation
RemovePollVoteMutation
- is the user able to remove the vote after submitting the vote?In general, if I'm missing something or you think something could be improved please let me know. Any feedback is appreciated!
Beta Was this translation helpful? Give feedback.
All reactions