schema.graphql 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397
  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: Int!
  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: Int!
  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. "Invalid 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: Int!
  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. # use `BigInt` instead of `Membership` before variant relations are featured in Hydra
  89. #"Member identifier"
  90. #memberId: Membership!
  91. "Member identifier"
  92. member: BigInt!
  93. "Variant needs to have at least one property. This value is not used."
  94. dummy: Int
  95. }
  96. "Asset owned by a channel"
  97. type DataObjectOwnerChannel @variant {
  98. # use `BigInt` instead of `Channel` before variant relations are featured in Hydra
  99. #"Channel identifier"
  100. #channel: Channel!
  101. "Channel identifier"
  102. channel: BigInt!
  103. "Variant needs to have at least one property. This value is not used."
  104. dummy: Int
  105. }
  106. "Asset owned by a DAO"
  107. type DataObjectOwnerDao @variant {
  108. "DAO identifier"
  109. dao: BigInt!
  110. }
  111. "Asset owned by the Council"
  112. type DataObjectOwnerCouncil @variant {
  113. "Variant needs to have at least one property. This value is not used."
  114. dummy: Int
  115. }
  116. "Asset owned by a WorkingGroup"
  117. type DataObjectOwnerWorkingGroup @variant {
  118. # TODO: working group doesn't seem to have id but rather `isStorage`, `isContent`, ... shoudl we care about that?
  119. #"Working group identifier"
  120. #workingGroup: BigInt!
  121. "Variant needs to have at least one property. This value is not used."
  122. dummy: Int
  123. }
  124. #### High Level Derivative Entities ####
  125. type Language @entity {
  126. "Runtime entity identifier (EntityId)"
  127. id: ID!
  128. "Language identifier ISO 639-1"
  129. iso: String!
  130. happenedIn: Int!
  131. }
  132. type Channel @entity {
  133. "Runtime entity identifier (EntityId)"
  134. id: ID!
  135. "Member owning the channel (if any)"
  136. ownerMember: Membership
  137. "Curator group owning the channel (if any)"
  138. ownerCuratorGroup: CuratorGroup
  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. ### Cover photo asset ###
  147. # Channel's cover (background) photo. Recommended ratio: 16:9.
  148. "Asset's data object"
  149. coverPhotoDataObject: DataObject
  150. "URLs where the asset content can be accessed (if any)"
  151. coverPhotoUrls: [String!]
  152. "Availability meta information"
  153. coverPhotoAvailability: AssetAvailability!
  154. ### Avatar photo asset ###
  155. # Channel's avatar photo.
  156. "Asset's data object"
  157. avatarDataObject: DataObject
  158. "URLs where the asset content can be accessed (if any)"
  159. avatarUrls: [String!]
  160. "Availability meta information"
  161. avatarAvailability: AssetAvailability!
  162. ##########################
  163. "Flag signaling whether a channel is public."
  164. isPublic: Boolean
  165. "Flag signaling whether a channel is censored."
  166. isCensored: Boolean!
  167. "The primary langauge of the channel's content"
  168. language: Language
  169. videos: [Video!]! @derivedFrom(field: "channel")
  170. happenedIn: Int!
  171. }
  172. type CuratorGroup @entity {
  173. "Runtime entity identifier (EntityId)"
  174. id: ID!
  175. "Curators belonging to this group"
  176. curatorIds: [BigInt!]!
  177. "Is group active or not"
  178. isActive: Boolean!
  179. channels: [Channel!]! @derivedFrom(field: "ownerCuratorGroup")
  180. }
  181. type VideoCategory @entity {
  182. "Runtime entity identifier (EntityId)"
  183. id: ID!
  184. "The name of the category"
  185. name: String @fulltext(query: "videoCategoriesByName")
  186. videos: [Video!]! @derivedFrom(field: "category")
  187. happenedIn: Int!
  188. }
  189. type Video @entity {
  190. "Runtime entity identifier (EntityId)"
  191. id: ID!
  192. "Reference to member's channel"
  193. channel: Channel!
  194. "Reference to a video category"
  195. category: VideoCategory
  196. "The title of the video"
  197. title: String @fulltext(query: "search")
  198. "The description of the Video"
  199. description: String
  200. "Video duration in seconds"
  201. duration: Int
  202. ### Thumbnail asset ###
  203. # Video thumbnail (recommended ratio: 16:9)
  204. "Asset's data object"
  205. thumbnailDataObject: DataObject
  206. "URLs where the asset content can be accessed (if any)"
  207. thumbnailUrls: [String!]
  208. "Availability meta information"
  209. thumbnailAvailability: AssetAvailability!
  210. ##########################
  211. "Video's main langauge"
  212. language: Language
  213. "Whether or not Video contains marketing"
  214. hasMarketing: Boolean
  215. "If the Video was published on other platform before beeing published on Joystream - the original publication date"
  216. publishedBeforeJoystream: DateTime
  217. "Whether the Video is supposed to be publically displayed"
  218. isPublic: Boolean
  219. "Flag signaling whether a video is censored."
  220. isCensored: Boolean!
  221. "Whether the Video contains explicit material."
  222. isExplicit: Boolean
  223. "License under the video is published"
  224. license: License
  225. ### Media asset ###
  226. # Reference to video asset
  227. "Asset's data object"
  228. mediaDataObject: DataObject
  229. "URLs where the asset content can be accessed (if any)"
  230. mediaUrls: [String!]
  231. "Availability meta information"
  232. mediaAvailability: AssetAvailability!
  233. ##########################
  234. "Video file metadata"
  235. mediaMetadata: VideoMediaMetadata
  236. happenedIn: Int!
  237. "Is video featured or not"
  238. isFeatured: Boolean!
  239. featured: FeaturedVideo @derivedFrom(field: "video")
  240. }
  241. type VideoMediaMetadata @entity {
  242. "Runtime entity identifier (EntityId)"
  243. id: ID!
  244. "Encoding of the video media object"
  245. encoding: VideoMediaEncoding
  246. "Video media width in pixels"
  247. pixelWidth: Int
  248. "Video media height in pixels"
  249. pixelHeight: Int
  250. "Video media size in bytes"
  251. size: BigInt
  252. video: Video @derivedFrom(field: "mediaMetadata")
  253. happenedIn: Int!
  254. }
  255. type VideoMediaEncoding @entity {
  256. "Encoding of the video media object"
  257. codecName: String
  258. "Media container format"
  259. container: String
  260. "Content MIME type"
  261. mimeMediaType: String
  262. }
  263. type License @entity {
  264. "Runtime entity identifier (EntityId)"
  265. id: ID!
  266. "License code defined by Joystream"
  267. code: Int
  268. "Attribution (if required by the license)"
  269. attribution: String
  270. "Custom license content"
  271. custom_text: String
  272. }
  273. type FeaturedVideo @entity {
  274. "Runtime entity identifier (EntityId)"
  275. id: ID!
  276. "Reference to a video"
  277. video: Video!
  278. }