prod-schema.graphql 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. schema
  2. @link(url: "https://specs.apollo.dev/link/v1.0")
  3. @link(url: "https://specs.apollo.dev/join/v0.3", for: EXECUTION)
  4. {
  5. query: Query
  6. mutation: Mutation
  7. }
  8. directive @join__enumValue(graph: join__Graph!) repeatable on ENUM_VALUE
  9. directive @join__field(graph: join__Graph, requires: join__FieldSet, provides: join__FieldSet, type: String, external: Boolean, override: String, usedOverridden: Boolean) repeatable on FIELD_DEFINITION | INPUT_FIELD_DEFINITION
  10. directive @join__graph(name: String!, url: String!) on ENUM_VALUE
  11. directive @join__implements(graph: join__Graph!, interface: String!) repeatable on OBJECT | INTERFACE
  12. directive @join__type(graph: join__Graph!, key: join__FieldSet, extension: Boolean! = false, resolvable: Boolean! = true, isInterfaceObject: Boolean! = false) repeatable on OBJECT | INTERFACE | UNION | ENUM | INPUT_OBJECT | SCALAR
  13. directive @join__unionMember(graph: join__Graph!, member: String!) repeatable on UNION
  14. directive @link(url: String, as: String, for: link__Purpose, import: [link__Import]) repeatable on SCHEMA
  15. type AccessTokenResponse
  16. @join__type(graph: AUTH)
  17. {
  18. access_token: String!
  19. id_token: String!
  20. token_type: String!
  21. expires_in: Int!
  22. refresh_token: String!
  23. refresh_expires_in: Int!
  24. not_before_policy: Int!
  25. session_state: String!
  26. scope: [String!]!
  27. }
  28. type Country
  29. @join__type(graph: SPORTS)
  30. {
  31. name: String!
  32. image: String
  33. }
  34. input Credentials
  35. @join__type(graph: AUTH)
  36. {
  37. username: String!
  38. password: String!
  39. }
  40. scalar DateTime
  41. @join__type(graph: AUTH)
  42. @join__type(graph: SPORTS)
  43. enum ErrorAuth
  44. @join__type(graph: AUTH)
  45. {
  46. ILLEGAL_USERNAME @join__enumValue(graph: AUTH)
  47. ALREADY_EXISTS @join__enumValue(graph: AUTH)
  48. INVALID_ARGUMENT @join__enumValue(graph: AUTH)
  49. }
  50. scalar Int64
  51. @join__type(graph: SPORTS)
  52. scalar join__FieldSet
  53. enum join__Graph {
  54. AUTH @join__graph(name: "auth", url: "https://auth.craft.beejay.kim")
  55. SPORTS @join__graph(name: "sports", url: "https://sports.craft.beejay.kim")
  56. }
  57. scalar JSON
  58. @join__type(graph: SPORTS)
  59. type Lane
  60. @join__type(graph: SPORTS)
  61. {
  62. key: String!
  63. value: Float!
  64. }
  65. type League
  66. @join__type(graph: SPORTS, key: "id")
  67. {
  68. id: Int64!
  69. name: String!
  70. image: String
  71. country: Country
  72. }
  73. scalar link__Import
  74. enum link__Purpose {
  75. """
  76. `SECURITY` features provide metadata necessary to securely resolve fields.
  77. """
  78. SECURITY
  79. """
  80. `EXECUTION` features provide metadata necessary for operation execution.
  81. """
  82. EXECUTION
  83. }
  84. type Market
  85. @join__type(graph: SPORTS)
  86. {
  87. match_id: Int64!
  88. market_id: Int64!
  89. status: Boolean!
  90. updated_at: DateTime!
  91. spreading: [MarketPoint!]!
  92. }
  93. type MarketPoint
  94. @join__type(graph: SPORTS)
  95. {
  96. value: Float
  97. status: Boolean!
  98. lanes: [Lane!]!
  99. }
  100. type Match
  101. @join__type(graph: SPORTS, key: "id")
  102. {
  103. id: Int64!
  104. sport: Sport!
  105. status: Int64!
  106. period: Int64!
  107. league: League!
  108. home_team: Team!
  109. away_team: Team!
  110. time: DateTime!
  111. timer: String
  112. score: JSON
  113. updated_at: DateTime!
  114. markets: [Market!]!
  115. }
  116. type MatchConnection
  117. @join__type(graph: SPORTS)
  118. {
  119. nodes: [Match!]!
  120. page_info: PageInfo!
  121. }
  122. input MatchCriteria
  123. @join__type(graph: SPORTS)
  124. {
  125. type: MatchType!
  126. sport: Sport
  127. league: Int
  128. }
  129. enum MatchType
  130. @join__type(graph: SPORTS)
  131. {
  132. Basic @join__enumValue(graph: SPORTS)
  133. Special @join__enumValue(graph: SPORTS)
  134. Live @join__enumValue(graph: SPORTS)
  135. Hybrid @join__enumValue(graph: SPORTS)
  136. }
  137. type Mutation
  138. @join__type(graph: AUTH)
  139. {
  140. Signup(credentials: Credentials!): String
  141. Login(credentials: Credentials!): AccessTokenResponse
  142. Logout(token: String!): Boolean!
  143. RefreshToken(token: String!): AccessTokenResponse
  144. }
  145. interface Node
  146. @join__type(graph: AUTH)
  147. {
  148. id: ID!
  149. }
  150. type PageInfo
  151. @join__type(graph: SPORTS)
  152. {
  153. total: Int!
  154. start_cursor: String
  155. end_cursor: String
  156. has_next_page: Boolean!
  157. has_previous_page: Boolean!
  158. }
  159. type Query
  160. @join__type(graph: AUTH)
  161. @join__type(graph: SPORTS)
  162. {
  163. User(id: ID!): User @join__field(graph: AUTH)
  164. Match(id: Int64!): Match @join__field(graph: SPORTS)
  165. Markets(match_id: Int64!): [Market!]! @join__field(graph: SPORTS)
  166. MatchList(after: String, before: String, first: Int, last: Int, reverse: Boolean = false, criteria: MatchCriteria!): MatchConnection! @join__field(graph: SPORTS)
  167. }
  168. enum Sport
  169. @join__type(graph: SPORTS)
  170. {
  171. soccer @join__enumValue(graph: SPORTS)
  172. basketball @join__enumValue(graph: SPORTS)
  173. baseball @join__enumValue(graph: SPORTS)
  174. volleyball @join__enumValue(graph: SPORTS)
  175. icehockey @join__enumValue(graph: SPORTS)
  176. tennis @join__enumValue(graph: SPORTS)
  177. esports @join__enumValue(graph: SPORTS)
  178. tabletennis @join__enumValue(graph: SPORTS)
  179. handball @join__enumValue(graph: SPORTS)
  180. americanfootball @join__enumValue(graph: SPORTS)
  181. boxing @join__enumValue(graph: SPORTS)
  182. }
  183. type Team
  184. @join__type(graph: SPORTS, key: "id")
  185. {
  186. id: Int64!
  187. name: String!
  188. image: String
  189. }
  190. type User implements Node
  191. @join__implements(graph: AUTH, interface: "Node")
  192. @join__type(graph: AUTH, key: "id")
  193. {
  194. id: ID!
  195. username: String!
  196. created_at: DateTime!
  197. enabled: Boolean!
  198. email_verified: Boolean!
  199. first_name: String
  200. last_name: String
  201. email: String
  202. level: Int!
  203. }