schema.graphql 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256
  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. timestamp: Int!
  11. nework: Network!
  12. }
  13. "Stored information about a registered user"
  14. type Member @entity {
  15. "MemberId: runtime identifier for a user"
  16. id: ID!
  17. "The unique handle chosen by member"
  18. handle: String @unique @fulltext(query: "handles")
  19. "A Url to member's Avatar image"
  20. avatarUri: String
  21. "Short text chosen by member to share information about themselves"
  22. about: String
  23. "Blocknumber when member was registered"
  24. registeredAtBlock: Int!
  25. "Member's controller account id"
  26. controllerAccount: Bytes!
  27. "Member's root account id"
  28. rootAccount: Bytes!
  29. happenedIn: Block!
  30. }
  31. """
  32. This type is to keep which entity belongs to which class. This type will be used
  33. by EntityCreated event. When a new schema support added to an Entity we will get the
  34. class name from this table.
  35. We need this because we can't create a database row (Channel, Video etc) without
  36. with empty fields.
  37. """
  38. type ClassEntity @entity {
  39. "Runtime entity identifier (EntityId)"
  40. id: ID!
  41. "The class id of this entity"
  42. classId: Int!
  43. happenedIn: Block!
  44. }
  45. #### High Level Derivative Entities ####
  46. type Language @entity {
  47. "Runtime entity identifier (EntityId)"
  48. id: ID!
  49. name: String!
  50. code: String!
  51. happenedIn: Block!
  52. }
  53. type Channel @entity {
  54. "Runtime entity identifier (EntityId)"
  55. id: ID!
  56. # "Owner of the channel" Commenting out this field: 'owner' can be curator_group, lead
  57. # or a member. We are not handling events related to curator group so we will not set this field
  58. # owner: Member!
  59. "The title of the Channel"
  60. title: String! @fulltext(query: "titles")
  61. "The description of a Channel"
  62. description: String!
  63. "Url for Channel's cover (background) photo. Recommended ratio: 16:9."
  64. coverPhotoURL: String!
  65. "Channel's avatar photo."
  66. avatarPhotoURL: String!
  67. "Flag signaling whether a channel is public."
  68. isPublic: Boolean!
  69. "Flag signaling whether a channel is curated/verified."
  70. isCurated: Boolean!
  71. "The primary langauge of the channel's content"
  72. languageId: Int
  73. # videos: [Video!] @derivedFrom(field: "channel")
  74. happenedIn: Block!
  75. }
  76. type Category @entity {
  77. "Runtime entity identifier (EntityId)"
  78. id: ID!
  79. "The name of the category"
  80. name: String! @unique @fulltext(query: "names")
  81. "The description of the category"
  82. description: String
  83. # videos: [Video!] @derivedFrom(field: "category")
  84. happenedIn: Block!
  85. }
  86. "Encoding and containers"
  87. type VideoMediaEncoding @entity {
  88. "Runtime entity identifier (EntityId)"
  89. id: ID!
  90. name: String!
  91. }
  92. type KnownLicense @entity {
  93. "Runtime entity identifier (EntityId)"
  94. id: ID!
  95. "Short, commonly recognized code of the licence (ie. CC_BY_SA)"
  96. code: String! @unique
  97. "Full, descriptive name of the license (ie. Creative Commons - Attribution-NonCommercial-NoDerivs)"
  98. name: String
  99. "Short description of the license conditions"
  100. description: String
  101. "An url pointing to full license content"
  102. url: String
  103. happenedIn: Block!
  104. }
  105. type UserDefinedLicense @entity {
  106. "Runtime entity identifier (EntityId)"
  107. id: ID!
  108. "Custom license content"
  109. content: String!
  110. happenedIn: Block!
  111. }
  112. type JoystreamMediaLocation @entity {
  113. "Runtime entity identifier (EntityId)"
  114. id: ID!
  115. "Id of the data object in the Joystream runtime dataDirectory module"
  116. dataObjectId: String! @unique
  117. happenedIn: Block!
  118. }
  119. type HttpMediaLocation @entity {
  120. "Runtime entity identifier (EntityId)"
  121. id: ID!
  122. "The http url pointing to the media"
  123. url: String!
  124. "The port to use when connecting to the http url (defaults to 80)"
  125. port: Int
  126. happenedIn: Block!
  127. }
  128. type VideoMedia @entity {
  129. "Runtime entity identifier (EntityId)"
  130. id: ID!
  131. "Encoding of the video media object"
  132. encodingId: Int!
  133. "Video media width in pixels"
  134. pixelWidth: Int!
  135. "Video media height in pixels"
  136. pixelHeight: Int!
  137. "Video media size in bytes"
  138. size: Int
  139. # video: Video! @derivedFrom(field: "media")
  140. # One of the location field will be non-null
  141. # httpMediaLocation: HttpMediaLocation
  142. # joystreamMediaLocation: JoystreamMediaLocation
  143. locationId: Int!
  144. happenedIn: Block!
  145. }
  146. type Video @entity {
  147. "Runtime entity identifier (EntityId)"
  148. id: ID!
  149. "Reference to member's channel"
  150. channelId: Int!
  151. "Reference to a video category"
  152. categoryId: Int!
  153. "The title of the video"
  154. title: String! @fulltext(query: "titles")
  155. "The description of the Video"
  156. description: String!
  157. "Video duration in seconds"
  158. duration: Int!
  159. "Video's skippable intro duration in seconds"
  160. skippableIntroDuration: Int
  161. "Video thumbnail url (recommended ratio: 16:9)"
  162. thumbnailURL: String!
  163. "Video's main langauge"
  164. languageId: Int
  165. "Reference to VideoMedia"
  166. videoMediaId: Int!
  167. "Whether or not Video contains marketing"
  168. hasMarketing: Boolean
  169. "If the Video was published on other platform before beeing published on Joystream - the original publication date"
  170. publishedBeforeJoystream: Int
  171. "Whether the Video is supposed to be publically displayed"
  172. isPublic: Boolean!
  173. "Video curation status set by the Curator"
  174. isCurated: Boolean!
  175. "Whether the Video contains explicit material."
  176. isExplicit: Boolean!
  177. # Lincense
  178. licenseId: Int!
  179. happenedIn: Block!
  180. }