Explorar el Código

Introduce a new subgraph: sports

Alexey Kim hace 9 meses
padre
commit
0550ab1312
Se han modificado 5 ficheros con 91 adiciones y 2 borrados
  1. 4 0
      .gitmodules
  2. 81 1
      devops/prod-schema.graphql
  3. 1 1
      graph/auth
  4. 1 0
      graph/sports
  5. 4 0
      supergraph.yaml

+ 4 - 0
.gitmodules

@@ -1,3 +1,7 @@
 [submodule "graph/auth"]
 	path = graph/auth
 	url = ssh://git@git.beejay.kim:2222/Craft/Auth.git
+[submodule "graph/sports"]
+	path = graph/sports
+	branch = main
+	url = ssh://git@git.beejay.kim:2222/Craft/sports.git

+ 81 - 1
devops/prod-schema.graphql

@@ -34,6 +34,13 @@ type AccessTokenResponse
   scope: [String!]!
 }
 
+type Country
+  @join__type(graph: SPORTS, key: "name")
+{
+  name: String!
+  image: String
+}
+
 input Credentials
   @join__type(graph: AUTH)
 {
@@ -43,6 +50,7 @@ input Credentials
 
 scalar DateTime
   @join__type(graph: AUTH)
+  @join__type(graph: SPORTS)
 
 enum ErrorAuth
   @join__type(graph: AUTH)
@@ -56,6 +64,20 @@ scalar join__FieldSet
 
 enum join__Graph {
   AUTH @join__graph(name: "auth", url: "https://auth.craft.beejay.kim")
+  SPORTS @join__graph(name: "sports", url: "https://sports.craft.beejay.kim")
+}
+
+scalar JSON
+  @join__type(graph: SPORTS)
+
+type League implements Node
+  @join__implements(graph: SPORTS, interface: "Node")
+  @join__type(graph: SPORTS, key: "id")
+{
+  id: ID!
+  name: String!
+  image: String
+  country: Country
 }
 
 scalar link__Import
@@ -72,6 +94,38 @@ enum link__Purpose {
   EXECUTION
 }
 
+type Match implements Node
+  @join__implements(graph: SPORTS, interface: "Node")
+  @join__type(graph: SPORTS, key: "id")
+{
+  id: ID!
+  status: Int!
+  period: Int!
+  league: League!
+  home_team: Team!
+  away_team: Team!
+  time: DateTime!
+  timer: String
+  score: JSON
+  updated_at: DateTime!
+}
+
+input MatchCriteria
+  @join__type(graph: SPORTS)
+{
+  type: MatchType!
+  sport: Sport
+  league: Int
+}
+
+enum MatchType
+  @join__type(graph: SPORTS)
+{
+  Basic @join__enumValue(graph: SPORTS)
+  Special @join__enumValue(graph: SPORTS)
+  Live @join__enumValue(graph: SPORTS)
+}
+
 type Mutation
   @join__type(graph: AUTH)
 {
@@ -82,14 +136,40 @@ type Mutation
 
 interface Node
   @join__type(graph: AUTH)
+  @join__type(graph: SPORTS)
 {
   id: ID!
 }
 
 type Query
   @join__type(graph: AUTH)
+  @join__type(graph: SPORTS)
+{
+  User(id: ID!): User @join__field(graph: AUTH)
+  MatchList(after: String, before: String, first: Int, last: Int, reverse: Boolean = false, criteria: MatchCriteria!): [Match!]! @join__field(graph: SPORTS)
+}
+
+enum Sport
+  @join__type(graph: SPORTS)
+{
+  soccer @join__enumValue(graph: SPORTS)
+  basketball @join__enumValue(graph: SPORTS)
+  baseball @join__enumValue(graph: SPORTS)
+  volleyball @join__enumValue(graph: SPORTS)
+  icehockey @join__enumValue(graph: SPORTS)
+  tennis @join__enumValue(graph: SPORTS)
+  esports @join__enumValue(graph: SPORTS)
+  tabletennis @join__enumValue(graph: SPORTS)
+  handball @join__enumValue(graph: SPORTS)
+}
+
+type Team implements Node
+  @join__implements(graph: SPORTS, interface: "Node")
+  @join__type(graph: SPORTS, key: "id")
 {
-  User(id: ID!): User
+  id: ID!
+  name: String
+  image: String
 }
 
 type User implements Node

+ 1 - 1
graph/auth

@@ -1 +1 @@
-Subproject commit a24fd89c238331198388a36c1e65409e6577c6db
+Subproject commit 3b6f85de676baf56268ba4441644cb8846c015df

+ 1 - 0
graph/sports

@@ -0,0 +1 @@
+Subproject commit 55a937cf2766e804b65ca291a048fb5bb02613f2

+ 4 - 0
supergraph.yaml

@@ -5,3 +5,7 @@ subgraphs:
     routing_url: https://auth.craft.beejay.kim
     schema:
       file: ./graph/auth/graph/schema.graphql
+  sports:
+    routing_url: https://sports.craft.beejay.kim
+    schema:
+      file: ./graph/sports/graph/schema.graphql