schema.graphql 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339
  1. enum Network {
  2. BABYLON
  3. ALEXANDRIA
  4. ROME
  5. }
  6. enum MembershipEntryMethod {
  7. PAID
  8. SCREENING
  9. GENESIS
  10. }
  11. "Stored information about a registered user"
  12. type Membership @entity {
  13. "MemberId: runtime identifier for a user"
  14. id: ID!
  15. "The unique handle chosen by member"
  16. handle: String! @unique @fulltext(query: "membersByHandle")
  17. "A Url to member's Avatar image"
  18. avatarUri: String
  19. "Short text chosen by member to share information about themselves"
  20. about: String
  21. "Member's controller account id"
  22. controllerAccount: String!
  23. "Member's root account id"
  24. rootAccount: String!
  25. "Blocknumber when member was registered"
  26. registeredAtBlock: BigInt!
  27. "Timestamp when member was registered"
  28. registeredAtTime: DateTime!
  29. "How the member was registered"
  30. entry: MembershipEntryMethod!
  31. "The type of subscription the member has purchased if any."
  32. subscription: BigInt
  33. }
  34. "Category of media channel"
  35. type ChannelCategory @entity {
  36. id: ID!
  37. "The name of the category"
  38. name: String @fulltext(query: "channelCategoriesByName")
  39. channels: [Channel!] @derivedFrom(field: "category")
  40. happenedIn: BigInt!
  41. }
  42. "Asset availability representation"
  43. enum AssetAvailability {
  44. "Asset is available in storage"
  45. ACCEPTED,
  46. "Asset is being uploaded to storage"
  47. PENDING,
  48. "Asset is referencing URL"
  49. URL,
  50. "Anvalid storage (meta)data used"
  51. INVALID,
  52. }
  53. "Asset representation"
  54. type Asset @entity {
  55. "Asset's data object"
  56. dataObject: DataObject
  57. "URLs where the asset content can be accessed (if any)"
  58. urls: [String!]
  59. "Availability meta information"
  60. availability: AssetAvailability!
  61. }
  62. "The decision of the storage provider when it acts as liaison"
  63. enum LiaisonJudgement {
  64. "Content awaits for a judgment"
  65. PENDING,
  66. "Content accepted"
  67. ACCEPTED,
  68. "Content rejected"
  69. REJECTED,
  70. }
  71. "Manages content ids, type and storage provider decision about it"
  72. type DataObject @entity {
  73. "Content owner"
  74. owner: DataObjectOwner!
  75. "Content added at"
  76. addedAt: BigInt!
  77. "Content type id"
  78. typeId: Int!
  79. "Content size in bytes"
  80. size: BigInt!
  81. "Storage provider id of the liaison"
  82. liaisonId: BigInt!
  83. "Storage provider as liaison judgment"
  84. liaisonJudgement: LiaisonJudgement!
  85. "IPFS content id"
  86. ipfsContentId: String!
  87. "Joystream runtime content"
  88. joystreamContentId: String!
  89. }
  90. "Owner type for storage object"
  91. union DataObjectOwner = DataObjectOwnerMember
  92. | DataObjectOwnerChannel
  93. | DataObjectOwnerDao
  94. | DataObjectOwnerCouncil
  95. | DataObjectOwnerWorkingGroup
  96. "Asset owned by a member"
  97. type DataObjectOwnerMember @variant {
  98. "Member identifier"
  99. memberId: Membership!
  100. "Variant needs to have at least one property. This value is not used."
  101. dummy: Int!
  102. }
  103. "Asset owned by a channel"
  104. type DataObjectOwnerChannel @variant {
  105. "Channel identifier"
  106. channel: Channel!
  107. "Variant needs to have at least one property. This value is not used."
  108. dummy: Int!
  109. }
  110. "Asset owned by a DAO"
  111. type DataObjectOwnerDao @variant {
  112. "DAO identifier"
  113. daoId: BigInt!
  114. }
  115. "Asset owned by the Council"
  116. type DataObjectOwnerCouncil @variant {
  117. "Variant needs to have at least one property. This value is not used."
  118. dummy: Int!
  119. }
  120. "Asset owned by a WorkingGroup"
  121. type DataObjectOwnerWorkingGroup @variant {
  122. "Working group identifier"
  123. workingGroupId: BigInt!
  124. }
  125. #### High Level Derivative Entities ####
  126. type Language @entity {
  127. "Runtime entity identifier (EntityId)"
  128. id: ID!
  129. "Language identifier ISO 639-1"
  130. iso: String!
  131. happenedIn: BigInt!
  132. }
  133. type Channel @entity {
  134. "Runtime entity identifier (EntityId)"
  135. id: ID!
  136. # "Owner of the channel" Commenting out this field: 'owner' can be curator_group, lead
  137. # or a member. We are not handling events related to curator group so we will not set this field
  138. # owner: Member!
  139. category: ChannelCategory
  140. "Reward account where revenue is sent if set."
  141. rewardAccount: String
  142. "The title of the Channel"
  143. title: String @fulltext(query: "search")
  144. "The description of a Channel"
  145. description: String
  146. "Channel's cover (background) photo. Recommended ratio: 16:9."
  147. coverPhoto: Asset
  148. "Channel's avatar photo."
  149. avatarPhoto: Asset
  150. "Flag signaling whether a channel is public."
  151. isPublic: Boolean
  152. "Flag signaling whether a channel is censored."
  153. isCensored: Boolean!
  154. "The primary langauge of the channel's content"
  155. language: Language
  156. videos: [Video!] @derivedFrom(field: "channel")
  157. happenedIn: BigInt!
  158. }
  159. type VideoCategory @entity {
  160. "Runtime entity identifier (EntityId)"
  161. id: ID!
  162. "The name of the category"
  163. name: String @fulltext(query: "videoCategoriesByName")
  164. videos: [Video!] @derivedFrom(field: "category")
  165. happenedIn: BigInt!
  166. }
  167. type Video @entity {
  168. "Runtime entity identifier (EntityId)"
  169. id: ID!
  170. "Reference to member's channel"
  171. channel: Channel!
  172. "Reference to a video category"
  173. category: VideoCategory
  174. "The title of the video"
  175. title: String @fulltext(query: "search")
  176. "The description of the Video"
  177. description: String
  178. "Video duration in seconds"
  179. duration: Int
  180. "Video thumbnail (recommended ratio: 16:9)"
  181. thumbnail: Asset
  182. "Video's main langauge"
  183. language: Language
  184. "Whether or not Video contains marketing"
  185. hasMarketing: Boolean
  186. "If the Video was published on other platform before beeing published on Joystream - the original publication date"
  187. publishedBeforeJoystream: DateTime
  188. "Whether the Video is supposed to be publically displayed"
  189. isPublic: Boolean
  190. "Flag signaling whether a video is censored."
  191. isCensored: Boolean!
  192. "Whether the Video contains explicit material."
  193. isExplicit: Boolean
  194. "License under the video is published"
  195. license: License
  196. "Reference to video asset"
  197. media: Asset
  198. "Video file metadata"
  199. mediaMetadata: VideoMediaMetadata
  200. happenedIn: BigInt!
  201. "Is video featured or not"
  202. isFeatured: Boolean!
  203. featured: FeaturedVideo @derivedFrom(field: "video")
  204. }
  205. type VideoMediaMetadata @entity {
  206. "Runtime entity identifier (EntityId)"
  207. id: ID!
  208. "Encoding of the video media object"
  209. encoding: VideoMediaEncoding
  210. "Video media width in pixels"
  211. pixelWidth: Int
  212. "Video media height in pixels"
  213. pixelHeight: Int
  214. "Video media size in bytes"
  215. size: Int
  216. video: Video @derivedFrom(field: "mediaMetadata")
  217. happenedIn: BigInt!
  218. }
  219. type VideoMediaEncoding @entity {
  220. "Encoding of the video media object"
  221. codecName: String
  222. "Media container format"
  223. container: String
  224. "Content MIME type"
  225. mimeMediaType: String
  226. }
  227. type License @entity {
  228. "Runtime entity identifier (EntityId)"
  229. id: ID!
  230. "License code defined by Joystream"
  231. code: Int
  232. "Attribution (if required by the license)"
  233. attribution: String
  234. "Custom license content"
  235. custom_text: String
  236. }
  237. type FeaturedVideo @entity {
  238. "Runtime entity identifier (EntityId)"
  239. id: ID!
  240. "Reference to a video"
  241. video: Video!
  242. }