prod-schema.graphql 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  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. }
  136. type Mutation
  137. @join__type(graph: AUTH)
  138. {
  139. Signup(credentials: Credentials!): String
  140. Login(credentials: Credentials!): AccessTokenResponse
  141. RefreshToken(token: String!): AccessTokenResponse
  142. }
  143. interface Node
  144. @join__type(graph: AUTH)
  145. {
  146. id: ID!
  147. }
  148. type PageInfo
  149. @join__type(graph: SPORTS)
  150. {
  151. start_cursor: String
  152. end_cursor: String
  153. has_next_page: Boolean!
  154. has_previous_page: Boolean!
  155. }
  156. type Query
  157. @join__type(graph: AUTH)
  158. @join__type(graph: SPORTS)
  159. {
  160. User(id: ID!): User @join__field(graph: AUTH)
  161. Match(id: Int64!): Match @join__field(graph: SPORTS)
  162. Markets(match_id: Int64!): [Market!]! @join__field(graph: SPORTS)
  163. MatchList(after: String, before: String, first: Int, last: Int, reverse: Boolean = false, criteria: MatchCriteria!): MatchConnection! @join__field(graph: SPORTS)
  164. }
  165. enum Sport
  166. @join__type(graph: SPORTS)
  167. {
  168. soccer @join__enumValue(graph: SPORTS)
  169. basketball @join__enumValue(graph: SPORTS)
  170. baseball @join__enumValue(graph: SPORTS)
  171. volleyball @join__enumValue(graph: SPORTS)
  172. icehockey @join__enumValue(graph: SPORTS)
  173. tennis @join__enumValue(graph: SPORTS)
  174. esports @join__enumValue(graph: SPORTS)
  175. tabletennis @join__enumValue(graph: SPORTS)
  176. handball @join__enumValue(graph: SPORTS)
  177. }
  178. type Team
  179. @join__type(graph: SPORTS, key: "id")
  180. {
  181. id: Int64!
  182. name: String!
  183. image: String
  184. }
  185. type User implements Node
  186. @join__implements(graph: AUTH, interface: "Node")
  187. @join__type(graph: AUTH, key: "id")
  188. {
  189. id: ID!
  190. username: String!
  191. created_at: DateTime!
  192. enabled: Boolean!
  193. email_verified: Boolean!
  194. first_name: String
  195. last_name: String
  196. email: String
  197. level: Int!
  198. }