43 lines
1.0 KiB
Go
43 lines
1.0 KiB
Go
package football
|
|
|
|
import (
|
|
"git.lehouerou.net/laurent/sorare/graphql"
|
|
)
|
|
|
|
type Club struct {
|
|
Team
|
|
DomesticLeague struct {
|
|
Slug string `graphql:"slug"`
|
|
} `graphql:"domesticLeague"`
|
|
}
|
|
|
|
func (f *Football) NewClubActivePlayersQuery(
|
|
clubSlug string,
|
|
) *graphql.PaginatedQuery[Player, graphql.EmptyParams] {
|
|
return graphql.NewPaginatedQuery[Player, graphql.EmptyParams](
|
|
f.c,
|
|
"activePlayers",
|
|
[]string{"football", "club(slug:$slug)"},
|
|
).WithQueryParam("slug", clubSlug)
|
|
}
|
|
|
|
func (f *Football) NewClubPlayersQuery(
|
|
clubSlug string,
|
|
) *graphql.PaginatedQuery[Player, graphql.EmptyParams] {
|
|
return graphql.NewPaginatedQuery[Player, graphql.EmptyParams](
|
|
f.c,
|
|
"players",
|
|
[]string{"football", "club(slug:$slug)"},
|
|
).WithQueryParam("slug", clubSlug)
|
|
}
|
|
|
|
func (f *Football) NewClubRecentDeparturesQuery(
|
|
clubSlug string,
|
|
) *graphql.PaginatedQuery[Player, graphql.EmptyParams] {
|
|
return graphql.NewPaginatedQuery[Player, graphql.EmptyParams](
|
|
f.c,
|
|
"recentDepartures",
|
|
[]string{"football", "club(slug:$slug)"},
|
|
).WithQueryParam("slug", clubSlug)
|
|
}
|