schema.graphql 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386
  1. enum Network {
  2. BABYLON
  3. ALEXANDRIA
  4. ROME
  5. }
  6. type Block @entity {
  7. "Block number as a string"
  8. id: ID!
  9. block: Int!
  10. executedAt: DateTime!
  11. network: Network!
  12. }
  13. enum MembershipEntryMethod {
  14. PAID
  15. SCREENING
  16. GENESIS
  17. }
  18. "Stored information about a registered user"
  19. type Membership @entity {
  20. "MemberId: runtime identifier for a user"
  21. id: ID!
  22. "The unique handle chosen by member"
  23. handle: String! @unique @fulltext(query: "membersByHandle")
  24. "A Url to member's Avatar image"
  25. avatarUri: String
  26. "Short text chosen by member to share information about themselves"
  27. about: String
  28. "Member's controller account id"
  29. controllerAccount: String!
  30. "Member's root account id"
  31. rootAccount: String!
  32. "Blocknumber when member was registered"
  33. registeredAtBlock: Block!
  34. "Timestamp when member was registered"
  35. registeredAtTime: DateTime!
  36. "How the member was registered"
  37. entry: MembershipEntryMethod!
  38. "The type of subscription the member has purchased if any."
  39. subscription: BigInt
  40. }
  41. "Category of media channel"
  42. type ChannelCategory @entity {
  43. id: ID!
  44. "The name of the category"
  45. name: String @fulltext(query: "channelCategoriesByName")
  46. channels: [Channel!] @derivedFrom(field: "category")
  47. happenedIn: Block!
  48. }
  49. "Storage asset"
  50. union Asset = AssetUrl | AssetStorage
  51. "Asset stored at an external source"
  52. type AssetUrl @variant {
  53. id: ID!
  54. "The http url pointing to the media"
  55. urls: [String!]
  56. }
  57. "Asset was never fully uploaded."
  58. type AssetNeverProvided @variant {
  59. happenedIn: Block!
  60. }
  61. "Asset was deleted and is no longer available."
  62. type AssetDeleted @variant {
  63. happenedIn: Block!
  64. }
  65. "Status of an asset upload"
  66. type AssetUploadStatus @variant {
  67. """
  68. Data object in upload life-cycle.
  69. If this is deleted, then set oldDataObject in its place if it is set and not rejected, otherwise union goes to Deleted.
  70. """
  71. dataObject: AssetDataObject!
  72. """
  73. Possible prior data object which was in some stage of upload life-cycle when new one was initiated.
  74. If accepted, then apps may chose to use old in place of new before it is accepted.
  75. If this is deleted, then set to null.
  76. """
  77. oldDataObject: AssetDataObject
  78. happenedIn: Block!
  79. }
  80. union AssetStorageUploadStatus = AssetNeverProvided | AssetDeleted | AssetUploadStatus
  81. type AssetStorage @variant {
  82. id: ID!
  83. "Upload to content directory status"
  84. uploadStatus: AssetStorageUploadStatus!
  85. }
  86. "The decision of the storage provider when it acts as liaison"
  87. enum LiaisonJudgement {
  88. "Content awaits for a judgment"
  89. PENDING,
  90. "Content accepted"
  91. ACCEPTED,
  92. "Content rejected"
  93. REJECTED,
  94. }
  95. "Manages content ids, type and storage provider decision about it"
  96. type AssetDataObject @entity {
  97. "Content owner"
  98. owner: AssetOwner!
  99. "Content added at"
  100. addedAt: Block!
  101. "Content type id"
  102. typeId: Int!
  103. "Content size in bytes"
  104. size: BigInt!
  105. "Storage provider id of the liaison"
  106. liaisonId: BigInt!
  107. "Storage provider as liaison judgment"
  108. liaisonJudgement: LiaisonJudgement!
  109. "IPFS content id"
  110. ipfsContentId: String!
  111. "Joystream runtime content"
  112. joystreamContentId: String!
  113. }
  114. "Owner type for storage object"
  115. union AssetOwner = AssetOwnerMember | AssetOwnerChannel | AssetOwnerDao | AssetOwnerCouncil | AssetOwnerWorkingGroup
  116. "Asset owned by a member"
  117. type AssetOwnerMember @variant {
  118. "Member identifier"
  119. memberId: BigInt!
  120. }
  121. "Asset owned by a channel"
  122. type AssetOwnerChannel @variant {
  123. "Channel identifier"
  124. channel: Channel!
  125. }
  126. "Asset owned by a DAO"
  127. type AssetOwnerDao @variant {
  128. "DAO identifier"
  129. daoId: BigInt!
  130. }
  131. "Asset owned by the Council"
  132. type AssetOwnerCouncil @variant {
  133. "Variant needs to have at least one property. This value is not used."
  134. dummy: Int!
  135. }
  136. "Asset owned by a WorkingGroup"
  137. type AssetOwnerWorkingGroup @variant {
  138. "Working group identifier"
  139. workingGroupId: BigInt!
  140. }
  141. #### High Level Derivative Entities ####
  142. type Language @entity {
  143. "Runtime entity identifier (EntityId)"
  144. id: ID!
  145. "Language identifier ISO 639-1"
  146. iso: String!
  147. happenedIn: Block!
  148. }
  149. type Channel @entity {
  150. "Runtime entity identifier (EntityId)"
  151. id: ID!
  152. "Owner of the channel"
  153. owner: ChannelOwner!
  154. category: ChannelCategory
  155. "Reward account where revenue is sent if set."
  156. rewardAccount: String
  157. "The title of the Channel"
  158. title: String @fulltext(query: "search")
  159. "The description of a Channel"
  160. description: String
  161. #"Channel's cover (background) photo. Recommended ratio: 16:9."
  162. #coverPhoto: Asset
  163. #"Channel's avatar photo."
  164. #avatarPhoto: Asset
  165. "Flag signaling whether a channel is public."
  166. isPublic: Boolean
  167. "Flag signaling whether a channel is censored."
  168. isCensored: Boolean!
  169. "The primary langauge of the channel's content"
  170. language: Language
  171. videos: [Video!] @derivedFrom(field: "channel")
  172. happenedIn: Block!
  173. }
  174. "Channel owner"
  175. union ChannelOwner = ChannelOwnerMember | ChannelCuratorGroup | ChannelOwnerDao
  176. type ChannelOwnerMember @variant {
  177. "Member identifier"
  178. memberId: BigInt!
  179. }
  180. type ChannelCuratorGroup @variant {
  181. "Curator group identifier"
  182. curatorGroupId: BigInt!
  183. }
  184. type ChannelOwnerDao @variant {
  185. "DAO identifier"
  186. daoId: BigInt!
  187. }
  188. type CuratorGroup @entity {
  189. "Runtime entity identifier (EntityId)"
  190. id: ID!
  191. "Curators belonging to this group"
  192. curatorIds: [BigInt!]
  193. "Is group active or not"
  194. isActive: Boolean!
  195. }
  196. type VideoCategory @entity {
  197. "Runtime entity identifier (EntityId)"
  198. id: ID!
  199. "The name of the category"
  200. name: String @fulltext(query: "videoCategoriesByName")
  201. videos: [Video!] @derivedFrom(field: "category")
  202. happenedIn: Block!
  203. }
  204. type Video @entity {
  205. "Runtime entity identifier (EntityId)"
  206. id: ID!
  207. "Reference to member's channel"
  208. channel: Channel!
  209. "Reference to a video category"
  210. category: VideoCategory
  211. "The title of the video"
  212. title: String @fulltext(query: "search")
  213. "The description of the Video"
  214. description: String
  215. "Video duration in seconds"
  216. duration: Int
  217. "Video thumbnail (recommended ratio: 16:9)"
  218. thumbnailPhoto: Asset
  219. "Video's main langauge"
  220. language: Language
  221. "Whether or not Video contains marketing"
  222. hasMarketing: Boolean
  223. "If the Video was published on other platform before beeing published on Joystream - the original publication date"
  224. publishedBeforeJoystream: DateTime
  225. "Whether the Video is supposed to be publically displayed"
  226. isPublic: Boolean
  227. "Flag signaling whether a video is censored."
  228. isCensored: Boolean!
  229. "Whether the Video contains explicit material."
  230. isExplicit: Boolean
  231. "License under the video is published"
  232. license: License
  233. "Reference to video asset"
  234. media: Asset
  235. "Video file metadata"
  236. mediaMetadata: VideoMediaMetadata
  237. happenedIn: Block!
  238. "Is video featured or not"
  239. isFeatured: Boolean!
  240. featured: FeaturedVideo @derivedFrom(field: "video")
  241. }
  242. type VideoMediaMetadata @entity {
  243. "Runtime entity identifier (EntityId)"
  244. id: ID!
  245. "Encoding of the video media object"
  246. encoding: VideoMediaEncoding
  247. "Video media width in pixels"
  248. pixelWidth: Int
  249. "Video media height in pixels"
  250. pixelHeight: Int
  251. "Video media size in bytes"
  252. size: Int
  253. video: Video @derivedFrom(field: "mediaMetadata")
  254. happenedIn: Block!
  255. }
  256. type VideoMediaEncoding @entity {
  257. "Encoding of the video media object"
  258. codecName: String
  259. "Media container format"
  260. container: String
  261. "Content MIME type"
  262. mimeMediaType: String
  263. }
  264. type License @entity {
  265. "Runtime entity identifier (EntityId)"
  266. id: ID!
  267. "License code defined by Joystream"
  268. code: Int
  269. "Attribution (if required by the license)"
  270. attribution: String
  271. "Custom license content"
  272. custom_text: String
  273. }
  274. type FeaturedVideo @entity {
  275. "Runtime entity identifier (EntityId)"
  276. id: ID!
  277. "Reference to a video"
  278. video: Video!
  279. }