videos.graphql 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  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. }
  84. type VideoFeaturedInCategory @entity @index(fields: ["category", "video"], unique: true) {
  85. "{categoryId-videoId}"
  86. id: ID!
  87. "Video being featured"
  88. video: Video!
  89. "Category the video is featured in"
  90. category: VideoCategory!
  91. "Url to video fragment to be displayed in the UI"
  92. videoCutUrl: String
  93. }
  94. type VideoHero @entity {
  95. "Unique ID"
  96. id: ID!
  97. "Video being featured in the Hero section"
  98. video: Video!
  99. "Title of the Hero section"
  100. heroTitle: String!
  101. "Url to video fragment to be displayed in the Hero section"
  102. heroVideoCutUrl: String!
  103. "Url to the poster to be displayed in the Hero section"
  104. heroPosterUrl: String!
  105. "Time at which this VideoHero was created/activated"
  106. activatedAt: DateTime
  107. }
  108. type VideoMediaMetadata @entity {
  109. "Unique identifier"
  110. id: ID!
  111. "Encoding of the video media object"
  112. encoding: VideoMediaEncoding
  113. "Video media width in pixels"
  114. pixelWidth: Int
  115. "Video media height in pixels"
  116. pixelHeight: Int
  117. "Video media size in bytes"
  118. size: BigInt
  119. video: Video! @unique
  120. createdInBlock: Int!
  121. }
  122. type VideoMediaEncoding @entity {
  123. "Encoding of the video media object"
  124. codecName: String
  125. "Media container format"
  126. container: String
  127. "Content MIME type"
  128. mimeMediaType: String
  129. }
  130. type License @entity {
  131. "Unique identifier"
  132. id: ID!
  133. "License code defined by Joystream"
  134. code: Int
  135. "Attribution (if required by the license)"
  136. attribution: String
  137. "Custom license content"
  138. customText: String
  139. }
  140. type VideoSubtitle @entity {
  141. "{type}-{language}"
  142. id: ID!
  143. "Subtitle's video"
  144. video: Video!
  145. # Atlas will use 'subtitles' | 'closed-captions' for now and possible other types in the future.
  146. "Subtitle's type"
  147. type: String!
  148. "Subtitle's language"
  149. language: String @index
  150. "MIME type description of format used for this subtitle"
  151. mimeType: String!
  152. "Storage object representing the subtitle file"
  153. asset: StorageDataObject
  154. }
  155. type VideoReactionsCountByReactionType {
  156. "The reaction option"
  157. reaction: VideoReactionOptions!
  158. "No of times the video has been reacted with given reaction"
  159. count: Int!
  160. }
  161. enum VideoReactionOptions {
  162. "Reacting again with the same option will cancel the previous reaction"
  163. LIKE
  164. UNLIKE
  165. }
  166. type VideoReaction @entity {
  167. "{memberId}-{videoId}"
  168. id: ID!
  169. "Timestamp of the block the reaction was created at"
  170. createdAt: DateTime!
  171. "The Reaction"
  172. reaction: VideoReactionOptions!
  173. "The member that reacted"
  174. member: Membership!
  175. "The video that has been reacted to"
  176. video: Video!
  177. }