Skip to content

Commit

Permalink
Feat: Resolve UpcomingFixture.team_h & UpcomingFixture.team_a wit…
Browse files Browse the repository at this point in the history
…h `Team` instead of `Int`
  • Loading branch information
AustinMusiku committed Sep 20, 2023
1 parent 0f1007a commit 9fd567f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 6 additions & 2 deletions src/resolvers/upcomingFixture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,13 @@ export const UpcomingFixture: UpcomingFixtureResolvers = {
is_home: ({ is_home }) => is_home,
kickoff_time: ({ kickoff_time }) => kickoff_time,
minutes: ({ minutes }) => minutes,
team_a: ({ team_a }) => team_a,
team_a: async ({ team_a }, _, { loaders }) => {
return await loaders.teamData.load(team_a)
},
team_a_difficulty: ({ team_a_difficulty }) => team_a_difficulty,
team_h: ({ team_h }) => team_h,
team_h: async ({ team_h }, _, { loaders }) => {
return await loaders.teamData.load(team_h)
},
team_h_difficulty: ({ team_h_difficulty }) => team_h_difficulty,
finished_provisional: ({ finished_provisional }) => finished_provisional,
started: ({ started }) => started,
Expand Down
4 changes: 2 additions & 2 deletions src/typeDefs/index.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,9 @@ type UpcomingFixture {
minutes: Int
pulse_id: Int
started: Boolean
team_a: Int
team_a: Team
team_a_difficulty: Int
team_h: Int
team_h: Team
team_h_difficulty: Int
}

Expand Down

0 comments on commit 9fd567f

Please sign in to comment.