schema.graphql 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387
  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. channels: [Channel!]! @derivedFrom(field: "ownerMember")
  34. }
  35. "Category of media channel"
  36. type ChannelCategory @entity {
  37. id: ID!
  38. "The name of the category"
  39. name: String @fulltext(query: "channelCategoriesByName")
  40. channels: [Channel!]! @derivedFrom(field: "category")
  41. happenedIn: BigInt!
  42. }
  43. "Asset availability representation"
  44. enum AssetAvailability {
  45. "Asset is available in storage"
  46. ACCEPTED,
  47. "Asset is being uploaded to storage"
  48. PENDING,
  49. "Anvalid storage (meta)data used"
  50. INVALID,
  51. }
  52. "The decision of the storage provider when it acts as liaison"
  53. enum LiaisonJudgement {
  54. "Content awaits for a judgment"
  55. PENDING,
  56. "Content accepted"
  57. ACCEPTED,
  58. "Content rejected"
  59. REJECTED,
  60. }
  61. "Manages content ids, type and storage provider decision about it"
  62. type DataObject @entity {
  63. "Content owner"
  64. owner: DataObjectOwner!
  65. "Content added at"
  66. addedAt: BigInt!
  67. "Content type id"
  68. typeId: Int!
  69. "Content size in bytes"
  70. size: BigInt!
  71. "Storage provider id of the liaison"
  72. liaisonId: BigInt!
  73. "Storage provider as liaison judgment"
  74. liaisonJudgement: LiaisonJudgement!
  75. "IPFS content id"
  76. ipfsContentId: String!
  77. "Joystream runtime content"
  78. joystreamContentId: String!
  79. }
  80. "Owner type for storage object"
  81. union DataObjectOwner = DataObjectOwnerMember
  82. | DataObjectOwnerChannel
  83. | DataObjectOwnerDao
  84. | DataObjectOwnerCouncil
  85. | DataObjectOwnerWorkingGroup
  86. "Asset owned by a member"
  87. type DataObjectOwnerMember @variant {
  88. "Member identifier"
  89. memberId: Membership!
  90. "Variant needs to have at least one property. This value is not used."
  91. dummy: Int!
  92. }
  93. "Asset owned by a channel"
  94. type DataObjectOwnerChannel @variant {
  95. "Channel identifier"
  96. channel: Channel!
  97. "Variant needs to have at least one property. This value is not used."
  98. dummy: Int!
  99. }
  100. "Asset owned by a DAO"
  101. type DataObjectOwnerDao @variant {
  102. "DAO identifier"
  103. daoId: BigInt!
  104. }
  105. "Asset owned by the Council"
  106. type DataObjectOwnerCouncil @variant {
  107. "Variant needs to have at least one property. This value is not used."
  108. dummy: Int!
  109. }
  110. "Asset owned by a WorkingGroup"
  111. type DataObjectOwnerWorkingGroup @variant {
  112. "Working group identifier"
  113. workingGroupId: BigInt!
  114. }
  115. #### High Level Derivative Entities ####
  116. type Language @entity {
  117. "Runtime entity identifier (EntityId)"
  118. id: ID!
  119. "Language identifier ISO 639-1"
  120. iso: String!
  121. happenedIn: BigInt!
  122. }
  123. type Channel @entity {
  124. "Runtime entity identifier (EntityId)"
  125. id: ID!
  126. "Member owning the channel (if any)"
  127. ownerMember: Membership
  128. "Curator group owning the channel (if any)"
  129. ownerCuratorGroup: CuratorGroup
  130. category: ChannelCategory
  131. "Reward account where revenue is sent if set."
  132. rewardAccount: String
  133. "The title of the Channel"
  134. title: String @fulltext(query: "search")
  135. "The description of a Channel"
  136. description: String
  137. ### Cover photo asset ###
  138. # Channel's cover (background) photo. Recommended ratio: 16:9.
  139. "Asset's data object"
  140. coverPhotoDataObject: DataObject
  141. "URLs where the asset content can be accessed (if any)"
  142. coverPhotoUrls: [String!]
  143. "Availability meta information"
  144. coverPhotoAvailability: AssetAvailability!
  145. ### Avatar photo asset ###
  146. # Channel's avatar photo.
  147. "Asset's data object"
  148. avatarDataObject: DataObject
  149. "URLs where the asset content can be accessed (if any)"
  150. avatarUrls: [String!]
  151. "Availability meta information"
  152. avatarAvailability: AssetAvailability!
  153. ##########################
  154. "Flag signaling whether a channel is public."
  155. isPublic: Boolean
  156. "Flag signaling whether a channel is censored."
  157. isCensored: Boolean!
  158. "The primary langauge of the channel's content"
  159. language: Language
  160. videos: [Video!]! @derivedFrom(field: "channel")
  161. happenedIn: BigInt!
  162. }
  163. type CuratorGroup @entity {
  164. "Runtime entity identifier (EntityId)"
  165. id: ID!
  166. "Curators belonging to this group"
  167. curatorIds: [BigInt!]!
  168. "Is group active or not"
  169. isActive: Boolean!
  170. channels: [Channel!]! @derivedFrom(field: "ownerCuratorGroup")
  171. }
  172. type VideoCategory @entity {
  173. "Runtime entity identifier (EntityId)"
  174. id: ID!
  175. "The name of the category"
  176. name: String @fulltext(query: "videoCategoriesByName")
  177. videos: [Video!]! @derivedFrom(field: "category")
  178. happenedIn: BigInt!
  179. }
  180. type Video @entity {
  181. "Runtime entity identifier (EntityId)"
  182. id: ID!
  183. "Reference to member's channel"
  184. channel: Channel!
  185. "Reference to a video category"
  186. category: VideoCategory
  187. "The title of the video"
  188. title: String @fulltext(query: "search")
  189. "The description of the Video"
  190. description: String
  191. "Video duration in seconds"
  192. duration: Int
  193. ### Thumbnail asset ###
  194. # Video thumbnail (recommended ratio: 16:9)
  195. "Asset's data object"
  196. thumbnailDataObject: DataObject
  197. "URLs where the asset content can be accessed (if any)"
  198. thumbnailUrls: [String!]
  199. "Availability meta information"
  200. thumbnailAvailability: AssetAvailability!
  201. ##########################
  202. "Video's main langauge"
  203. language: Language
  204. "Whether or not Video contains marketing"
  205. hasMarketing: Boolean
  206. "If the Video was published on other platform before beeing published on Joystream - the original publication date"
  207. publishedBeforeJoystream: DateTime
  208. "Whether the Video is supposed to be publically displayed"
  209. isPublic: Boolean
  210. "Flag signaling whether a video is censored."
  211. isCensored: Boolean!
  212. "Whether the Video contains explicit material."
  213. isExplicit: Boolean
  214. "License under the video is published"
  215. license: License
  216. ### Media asset ###
  217. # Reference to video asset
  218. "Asset's data object"
  219. mediaDataObject: DataObject
  220. "URLs where the asset content can be accessed (if any)"
  221. mediaUrls: [String!]
  222. "Availability meta information"
  223. mediaAvailability: AssetAvailability!
  224. ##########################
  225. "Video file metadata"
  226. mediaMetadata: VideoMediaMetadata
  227. happenedIn: BigInt!
  228. "Is video featured or not"
  229. isFeatured: Boolean!
  230. featured: FeaturedVideo @derivedFrom(field: "video")
  231. }
  232. type VideoMediaMetadata @entity {
  233. "Runtime entity identifier (EntityId)"
  234. id: ID!
  235. "Encoding of the video media object"
  236. encoding: VideoMediaEncoding
  237. "Video media width in pixels"
  238. pixelWidth: Int
  239. "Video media height in pixels"
  240. pixelHeight: Int
  241. "Video media size in bytes"
  242. size: Int
  243. video: Video @derivedFrom(field: "mediaMetadata")
  244. happenedIn: BigInt!
  245. }
  246. type VideoMediaEncoding @entity {
  247. "Encoding of the video media object"
  248. codecName: String
  249. "Media container format"
  250. container: String
  251. "Content MIME type"
  252. mimeMediaType: String
  253. }
  254. type License @entity {
  255. "Runtime entity identifier (EntityId)"
  256. id: ID!
  257. "License code defined by Joystream"
  258. code: Int
  259. "Attribution (if required by the license)"
  260. attribution: String
  261. "Custom license content"
  262. custom_text: String
  263. }
  264. type FeaturedVideo @entity {
  265. "Runtime entity identifier (EntityId)"
  266. id: ID!
  267. "Reference to a video"
  268. video: Video!
  269. }