proposalDiscussion.graphql 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. type ProposalDiscussionThreadModeOpen @variant {
  2. _phantom: Int
  3. }
  4. type ProposalDiscussionWhitelist @entity {
  5. # Prevents "GraphQLError: Input Object type ProposalDiscussionWhitelistCreateInput must define one or more fields."
  6. _phantom: Int
  7. "List of members allowed to participate in the discussion"
  8. members: [Membership!]
  9. }
  10. type ProposalDiscussionThreadModeClosed @variant {
  11. # Sidesteps no direct One-to-Many varaint relationships issue
  12. "Whitelist containing members allowed to participate in the discussion"
  13. whitelist: ProposalDiscussionWhitelist!
  14. }
  15. union ProposalDiscussionThreadMode = ProposalDiscussionThreadModeOpen | ProposalDiscussionThreadModeClosed
  16. type ProposalDiscussionThread @entity {
  17. "Proposal discussion thread runtime id"
  18. id: ID!
  19. "The proposal the thread is related to"
  20. proposal: Proposal!
  21. "List of posts in the the thread"
  22. posts: [ProposalDiscussionPost!] @derivedFrom(field: "discussionThread")
  23. "Current thread mode"
  24. mode: ProposalDiscussionThreadMode!
  25. "List of related thread mode change events"
  26. modeChanges: [ProposalDiscussionThreadModeChangedEvent!] @derivedFrom(field: "thread")
  27. }
  28. "The post is visible and editable"
  29. type ProposalDiscussionPostStatusActive @variant {
  30. _phantom: Int
  31. }
  32. "The post is visible, but not editable"
  33. type ProposalDiscussionPostStatusLocked @variant {
  34. "ProposalDiscussionPostDeletedEvent in case the post became locked through runtime removal"
  35. deletedInEvent: ProposalDiscussionPostDeletedEvent
  36. }
  37. "The post is removed and hidden"
  38. type ProposalDiscussionPostStatusRemoved @variant {
  39. "The event the post was removed in"
  40. deletedInEvent: ProposalDiscussionPostDeletedEvent!
  41. }
  42. union ProposalDiscussionPostStatus =
  43. ProposalDiscussionPostStatusActive
  44. | ProposalDiscussionPostStatusLocked
  45. | ProposalDiscussionPostStatusRemoved
  46. type ProposalDiscussionPost @entity {
  47. "Proposal discussion post runtime id"
  48. id: ID!
  49. "Proposal discussion thread the post was created in"
  50. discussionThread: ProposalDiscussionThread!
  51. "The author of the post"
  52. author: Membership!
  53. "Current post status"
  54. status: ProposalDiscussionPostStatus!
  55. "True if the post is either Active or Locked"
  56. isVisible: Boolean!
  57. "Post's md-formatted text"
  58. text: String!
  59. "The post that this post replies to (if any)"
  60. repliesTo: ProposalDiscussionPost
  61. "List of events the post text was updated in"
  62. updates: [ProposalDiscussionPostUpdatedEvent!] @derivedFrom(field: "post")
  63. "The event the post was created in"
  64. createdInEvent: ProposalDiscussionPostCreatedEvent! @derivedFrom(field: "post")
  65. }