49 lines
1.4 KiB
Go
49 lines
1.4 KiB
Go
package football
|
|
|
|
import (
|
|
"time"
|
|
|
|
gql "github.com/llehouerou/go-graphql-client"
|
|
|
|
"git.lehouerou.net/laurent/sorare/graphql"
|
|
"git.lehouerou.net/laurent/sorare/types"
|
|
)
|
|
|
|
type So5Fixture struct {
|
|
AasmState string `graphql:"aasmState"`
|
|
CanCompose bool `graphql:"canCompose"`
|
|
CutOffDate time.Time `graphql:"cutOffDate"`
|
|
DisplayName string `graphql:"displayName"`
|
|
EndDate time.Time `graphql:"endDate"`
|
|
EventType string `graphql:"eventType"`
|
|
GameWeek int `graphql:"gameWeek"`
|
|
Id graphql.Id `graphql:"id"`
|
|
ReplayedFixture struct {
|
|
Slug string `graphql:"slug"`
|
|
} `graphql:"replayedFixture"`
|
|
RewardsDeliveryDate time.Time `graphql:"rewardsDeliveryDate"`
|
|
ShortDisplayName string `graphql:"shortDisplayName"`
|
|
Slug string `graphql:"slug"`
|
|
StartDate time.Time `graphql:"startDate"`
|
|
}
|
|
|
|
type So5FixtureParams struct {
|
|
Id *gql.ID `graphql:"id"`
|
|
Slug *string `graphql:"slug"`
|
|
Type *types.So5State `graphql:"type"`
|
|
}
|
|
|
|
type So5FixturesParams struct {
|
|
AasmStates []string `graphql:"aasmStates"`
|
|
}
|
|
|
|
func (s *So5) FixtureGames(
|
|
so5FixtureSlug string,
|
|
) *graphql.Query[[]Game, graphql.EmptyParams] {
|
|
return graphql.NewQuery[[]Game, graphql.EmptyParams](
|
|
s.c,
|
|
"games",
|
|
[]string{"football", "so5", "so5Fixture(slug:$slug)"},
|
|
).WithQueryParam("slug", so5FixtureSlug)
|
|
}
|