schema.graphql 8.1 KB

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