9b8e266f88
- Team page: add Tournament Participations (year pills → /tournaments/[year]) and Match History (grouped by year, W/D/L badge, opponent, score from team's perspective, PSO/AET annotations, each row → match anchor) - GraphQL: extend matches() query with teamId filter (OR team1_id/team2_id) - Match card: link team names to /teams/[slug]; fix ET score display — show scoreEt as headline for AET matches, scoreFt as footnote; winner determination uses scoreP ?? scoreEt ?? scoreFt - Tournament page: scorer names below each match linked to /players/[name] with dotted underline (solid + green on hover) - Stats page: reduce mobile padding on Goals chart, Top Scorers, Titles, Goals by Minute — hide progress bars and trophy emojis on small screens - Homepage: Golden Boot Race same mobile padding/bar treatment; add slug to match team queries Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
200 lines
3.7 KiB
TypeScript
200 lines
3.7 KiB
TypeScript
export const typeDefs = /* GraphQL */ `
|
|
type Tournament {
|
|
year: Int!
|
|
host: String!
|
|
winner: String
|
|
runnerUp: String
|
|
thirdPlace: String
|
|
fourthPlace: String
|
|
teamsCount: Int
|
|
matchesCount: Int
|
|
totalGoals: Int
|
|
avgGoalsPerGame: Float
|
|
topScorers(limit: Int): [ScorerEntry!]!
|
|
matches: [Match!]!
|
|
}
|
|
|
|
type Team {
|
|
id: Int!
|
|
name: String!
|
|
slug: String!
|
|
iso2: String
|
|
fifaCode: String
|
|
continent: String
|
|
confederation: String
|
|
stats: TeamStats
|
|
}
|
|
|
|
type TeamStats {
|
|
appearances: Int!
|
|
wins: Int!
|
|
draws: Int!
|
|
losses: Int!
|
|
goalsFor: Int!
|
|
goalsAgainst: Int!
|
|
goalDiff: Int!
|
|
titles: Int!
|
|
winPct: Float!
|
|
}
|
|
|
|
type Stadium {
|
|
id: Int!
|
|
tournamentYear: Int
|
|
name: String!
|
|
city: String
|
|
countryCode: String
|
|
capacity: Int
|
|
timezone: String
|
|
coordinates: String
|
|
matchCount: Int
|
|
}
|
|
|
|
type Match {
|
|
id: Int!
|
|
year: Int!
|
|
round: String!
|
|
group: String
|
|
date: String
|
|
time: String
|
|
stadium: String
|
|
team1: Team!
|
|
team2: Team!
|
|
scoreFt: [Int!]
|
|
scoreHt: [Int!]
|
|
scoreEt: [Int!]
|
|
scoreP: [Int!]
|
|
goals: [Goal!]!
|
|
isLive: Boolean!
|
|
isQualiPlayoff: Boolean!
|
|
margin: Int
|
|
totalGoals: Int
|
|
}
|
|
|
|
type Goal {
|
|
id: Int!
|
|
team: Team!
|
|
playerName: String!
|
|
minute: Int
|
|
minuteOffset: Int
|
|
isPenalty: Boolean!
|
|
isOwnGoal: Boolean!
|
|
}
|
|
|
|
type ScorerEntry {
|
|
playerName: String!
|
|
team: Team
|
|
goals: Int!
|
|
penalties: Int!
|
|
ownGoals: Int!
|
|
tournaments: Int!
|
|
}
|
|
|
|
type GroupStanding {
|
|
groupName: String!
|
|
pos: Int
|
|
team: Team!
|
|
played: Int!
|
|
won: Int!
|
|
drawn: Int!
|
|
lost: Int!
|
|
goalsFor: Int!
|
|
goalsAgainst: Int!
|
|
goalDiff: Int!
|
|
pts: Int!
|
|
}
|
|
|
|
type SquadPlayer {
|
|
playerName: String!
|
|
shirtNumber: Int
|
|
position: String
|
|
dateOfBirth: String
|
|
team: Team!
|
|
age: Int
|
|
}
|
|
|
|
type GlobalStats {
|
|
totalTournaments: Int!
|
|
totalMatches: Int!
|
|
totalGoals: Int!
|
|
avgGoalsPerGame: Float!
|
|
mostGoalsInTournament: TournamentGoalRecord
|
|
highestScoringMatch: Match
|
|
biggestWin: Match
|
|
mostTitles: ScorerEntry
|
|
}
|
|
|
|
type TournamentGoalRecord {
|
|
year: Int!
|
|
host: String!
|
|
totalGoals: Int!
|
|
}
|
|
|
|
type HatTrick {
|
|
playerName: String!
|
|
team: Team
|
|
year: Int!
|
|
round: String!
|
|
opponent: Team
|
|
goals: Int!
|
|
}
|
|
|
|
type MinuteBucket {
|
|
bucket: String!
|
|
count: Int!
|
|
}
|
|
|
|
type ConfederationStat {
|
|
confederation: String!
|
|
appearances: Int!
|
|
titles: Int!
|
|
totalGoals: Int!
|
|
}
|
|
|
|
type SearchResults {
|
|
tournaments: [Tournament!]!
|
|
teams: [Team!]!
|
|
players: [ScorerEntry!]!
|
|
matches: [Match!]!
|
|
}
|
|
|
|
type Query {
|
|
tournaments: [Tournament!]!
|
|
tournament(year: Int!): Tournament
|
|
|
|
matches(year: Int, group: String, round: String, isQuali: Boolean, teamId: Int): [Match!]!
|
|
match(id: Int!): Match
|
|
liveMatches: [Match!]!
|
|
recentMatches(limit: Int): [Match!]!
|
|
upcomingMatches(limit: Int): [Match!]!
|
|
|
|
teams: [Team!]!
|
|
team(slug: String!): Team
|
|
|
|
topScorers(year: Int, limit: Int): [ScorerEntry!]!
|
|
player(name: String!): ScorerEntry
|
|
hatTricks(year: Int): [HatTrick!]!
|
|
|
|
groupStandings(year: Int!): [GroupStanding!]!
|
|
|
|
stadiums(year: Int): [Stadium!]!
|
|
squads(year: Int!, team: String): [SquadPlayer!]!
|
|
|
|
tournamentStats: GlobalStats!
|
|
goalsByMinute: [MinuteBucket!]!
|
|
confederationStats: [ConfederationStat!]!
|
|
biggestWins(limit: Int): [Match!]!
|
|
highestScoringMatches(limit: Int): [Match!]!
|
|
extraTimeStats: ExtraTimeStats!
|
|
|
|
search(query: String!): SearchResults!
|
|
}
|
|
|
|
type ExtraTimeStats {
|
|
totalKnockoutMatches: Int!
|
|
wentToExtraTime: Int!
|
|
wentToPenalties: Int!
|
|
extraTimePct: Float!
|
|
penaltiesPct: Float!
|
|
}
|
|
`
|