videos.graphql 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  1. type VideoCategory @entity {
  2. "Runtime identifier"
  3. id: ID!
  4. "The name of the category"
  5. name: String @index
  6. "The description of the category"
  7. description: String
  8. "Parent category if defined"
  9. parentCategory: VideoCategory
  10. videos: [Video!]! @derivedFrom(field: "category")
  11. featuredVideos: [VideoFeaturedInCategory!] @derivedFrom(field: "category")
  12. "Indicates whether the category is supported by the Gateway"
  13. isSupported: Boolean!
  14. createdInBlock: Int!
  15. }
  16. type Video @entity {
  17. "Runtime identifier"
  18. id: ID!
  19. "Timestamp of the block the video was created at"
  20. createdAt: DateTime!
  21. "Reference to videos's channel"
  22. channel: Channel!
  23. "Reference to a video category"
  24. category: VideoCategory
  25. "The title of the video"
  26. title: String
  27. "The description of the Video"
  28. description: String
  29. "Video duration in seconds"
  30. duration: Int
  31. "Video thumbnail asset (recommended ratio: 16:9)"
  32. thumbnailPhoto: StorageDataObject
  33. "Video's main langauge"
  34. language: String @index
  35. "Whether or not Video contains marketing"
  36. hasMarketing: Boolean
  37. "If the Video was published on other platform before beeing published on Joystream - the original publication date"
  38. publishedBeforeJoystream: DateTime
  39. "Whether the Video is supposed to be publically displayed"
  40. isPublic: Boolean
  41. "Flag signaling whether a video is censored."
  42. isCensored: Boolean!
  43. "Whether a video has been excluded/hidden (by the gateway operator)"
  44. isExcluded: Boolean!
  45. "Video NFT details"
  46. nft: OwnedNft @derivedFrom(field: "video")
  47. "Whether the Video contains explicit material."
  48. isExplicit: Boolean
  49. "License under the video is published"
  50. license: License
  51. "Video media asset"
  52. media: StorageDataObject
  53. "Value of video state bloat bond fee paid by channel owner"
  54. videoStateBloatBond: BigInt!
  55. "Video file metadata"
  56. mediaMetadata: VideoMediaMetadata @derivedFrom(field: "video")
  57. "Block the video was created in"
  58. createdInBlock: Int!
  59. "List of video subtitles"
  60. subtitles: [VideoSubtitle!] @derivedFrom(field: "video")
  61. "Is comment section enabled (true if enabled)"
  62. isCommentSectionEnabled: Boolean!
  63. "channel owner pinned comment"
  64. pinnedComment: Comment
  65. "List of all video comments"
  66. comments: [Comment!] @derivedFrom(field: "video")
  67. "Comments count"
  68. commentsCount: Int!
  69. "Is reactions feature enabled on video (true if enabled i.e. video can be reacted)"
  70. isReactionFeatureEnabled: Boolean!
  71. "List of all video reactions"
  72. reactions: [VideoReaction!] @derivedFrom(field: "video")
  73. "Reactions count by reaction Id"
  74. reactionsCountByReactionId: [VideoReactionsCountByReactionType!]
  75. "Reactions count"
  76. reactionsCount: Int!
  77. "Number of video views (to speed up orderBy queries by avoiding COUNT aggregation)"
  78. viewsNum: Int!
  79. "Application used for video creation"
  80. entryApp: App
  81. "Video ID coming from YPP"
  82. ytVideoId: String
  83. "Video relevance score based on the views, reactions, comments and update date"
  84. videoRelevance: Float!
  85. }
  86. type VideoFeaturedInCategory @entity @index(fields: ["category", "video"], unique: true) {
  87. "{categoryId-videoId}"
  88. id: ID!
  89. "Video being featured"
  90. video: Video!
  91. "Category the video is featured in"
  92. category: VideoCategory!
  93. "Url to video fragment to be displayed in the UI"
  94. videoCutUrl: String
  95. }
  96. type VideoHero @entity {
  97. "Unique ID"
  98. id: ID!
  99. "Video being featured in the Hero section"
  100. video: Video!
  101. "Title of the Hero section"
  102. heroTitle: String!
  103. "Url to video fragment to be displayed in the Hero section"
  104. heroVideoCutUrl: String!
  105. "Url to the poster to be displayed in the Hero section"
  106. heroPosterUrl: String!
  107. "Time at which this VideoHero was created/activated"
  108. activatedAt: DateTime
  109. }
  110. type VideoMediaMetadata @entity {
  111. "Unique identifier"
  112. id: ID!
  113. "Encoding of the video media object"
  114. encoding: VideoMediaEncoding
  115. "Video media width in pixels"
  116. pixelWidth: Int
  117. "Video media height in pixels"
  118. pixelHeight: Int
  119. "Video media size in bytes"
  120. size: BigInt
  121. video: Video! @unique
  122. createdInBlock: Int!
  123. }
  124. type VideoMediaEncoding @entity {
  125. "Encoding of the video media object"
  126. codecName: String
  127. "Media container format"
  128. container: String
  129. "Content MIME type"
  130. mimeMediaType: String
  131. }
  132. type License @entity {
  133. "Unique identifier"
  134. id: ID!
  135. "License code defined by Joystream"
  136. code: Int
  137. "Attribution (if required by the license)"
  138. attribution: String
  139. "Custom license content"
  140. customText: String
  141. }
  142. type VideoSubtitle @entity {
  143. "{type}-{language}"
  144. id: ID!
  145. "Subtitle's video"
  146. video: Video!
  147. # Atlas will use 'subtitles' | 'closed-captions' for now and possible other types in the future.
  148. "Subtitle's type"
  149. type: String!
  150. "Subtitle's language"
  151. language: String @index
  152. "MIME type description of format used for this subtitle"
  153. mimeType: String!
  154. "Storage object representing the subtitle file"
  155. asset: StorageDataObject
  156. }
  157. type VideoReactionsCountByReactionType {
  158. "The reaction option"
  159. reaction: VideoReactionOptions!
  160. "No of times the video has been reacted with given reaction"
  161. count: Int!
  162. }
  163. enum VideoReactionOptions {
  164. "Reacting again with the same option will cancel the previous reaction"
  165. LIKE
  166. UNLIKE
  167. }
  168. type VideoReaction @entity {
  169. "{memberId}-{videoId}"
  170. id: ID!
  171. "Timestamp of the block the reaction was created at"
  172. createdAt: DateTime!
  173. "The Reaction"
  174. reaction: VideoReactionOptions!
  175. "The member that reacted"
  176. member: Membership!
  177. "The video that has been reacted to"
  178. video: Video!
  179. }