From 8041f6835f08d82672253772875c016b02fb20a6 Mon Sep 17 00:00:00 2001 From: Laurent Le Houerou Date: Sun, 7 Apr 2024 13:51:04 +0400 Subject: [PATCH] move from clubmemberships to memberships to get also national memberships --- football/player.go | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/football/player.go b/football/player.go index 959341b..07a9b39 100644 --- a/football/player.go +++ b/football/player.go @@ -40,13 +40,19 @@ type CardSupply struct { Unique int `graphql:"unique"` } -type ClubMembership struct { - Id graphql.Id `graphql:"id"` - Club struct { - Slug string `graphql:"slug"` - } `graphql:"club"` - StartDate time.Time `graphql:"startDate"` - EndDate *time.Time `graphql:"endDate"` +type Membership struct { + Id graphql.Id `graphql:"id"` + StartDate time.Time `graphql:"startDate"` + EndDate *time.Time `graphql:"endDate"` + MembershipTeam struct { + TypeName string `graphql:"__typename"` + Club struct { + Slug string `graphql:"slug"` + } `graphql:"... on Club"` + NationalTeam struct { + Slug string `graphql:"slug"` + } `graphql:"... on NationalTeam"` + } `graphql:"membershipTeam"` } type Player struct { @@ -68,8 +74,8 @@ type Player struct { BirthDate time.Time `graphql:"birthDate"` CardPositions []types.Position `graphql:"cardPositions"` CardSupply []CardSupply `graphql:"cardSupply"` - ClubMemberships []ClubMembership `graphql:"clubMemberships"` Id graphql.Id `graphql:"id"` + Memberships []Membership `graphql:"memberships"` Slug string `graphql:"slug"` DisplayName string `graphql:"displayName"` FirstName string `graphql:"firstName"`