sdk is working now with api v0.8

This commit is contained in:
Dawid Wysokiński 2020-06-23 16:56:13 +02:00
parent abf60bdf85
commit 0fb6430054
5 changed files with 15 additions and 4 deletions

2
go.mod
View File

@ -5,5 +5,5 @@ go 1.14
require (
github.com/Kichiyaki/gqlgen-client v0.0.0-20200604145848-274796c104f4
github.com/pkg/errors v0.9.1
github.com/tribalwarshelp/shared v0.0.0-20200621115742-5ae0d5ec33f2
github.com/tribalwarshelp/shared v0.0.0-20200623144748-aa834a01dce6
)

2
go.sum
View File

@ -25,6 +25,8 @@ github.com/tribalwarshelp/shared v0.0.0-20200621113135-f37b4069eaaf h1:FoZBGciPI
github.com/tribalwarshelp/shared v0.0.0-20200621113135-f37b4069eaaf/go.mod h1:tf+2yTHasV6jAF3V2deZ9slNoCyBzC0fMdTjI7clf6Y=
github.com/tribalwarshelp/shared v0.0.0-20200621115742-5ae0d5ec33f2 h1:xHR69AkeSO34WkjYlTSzD6v2X37hY68e53o6GEoIyFs=
github.com/tribalwarshelp/shared v0.0.0-20200621115742-5ae0d5ec33f2/go.mod h1:tf+2yTHasV6jAF3V2deZ9slNoCyBzC0fMdTjI7clf6Y=
github.com/tribalwarshelp/shared v0.0.0-20200623144748-aa834a01dce6 h1:WZ1oxHysFtiPjHa2ADUqiGrzwcN3j0YpiVg/V2e/74o=
github.com/tribalwarshelp/shared v0.0.0-20200623144748-aa834a01dce6/go.mod h1:tf+2yTHasV6jAF3V2deZ9slNoCyBzC0fMdTjI7clf6Y=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=

View File

@ -89,7 +89,7 @@ func main() {
log.Println(tribe.ID, tribe.Name, tribe.Tag, tribe.RankAtt, tribe.RankDef)
}
village, err := api.Villages.Read("pl151", 28299, &sdk.VillageInclude{
village, err := api.Villages.Read("pl151", 28120, &sdk.VillageInclude{
Player: true,
PlayerInclude: sdk.PlayerInclude{
Tribe: true,

View File

@ -31,6 +31,8 @@ var (
points
rank
exist
dailyGrowth
joinedAt
%s
`, playerODFields)
tribeFields = fmt.Sprintf(`
@ -43,6 +45,8 @@ var (
allPoints
rank
exist
dominance
createdAt
%s
`, commonODFields)
villageFields = `

View File

@ -38,10 +38,14 @@ func (ss *Servers) Read(key string, incl *ServerInclude) (*models.Server, error)
query := fmt.Sprintf(`
query server($key: String!) {
server(key: $key) {
id
key
status
dataUpdatedAt
historyUpdatedAt
statsUpdatedAt
numberOfTribes
numberOfPlayers
numberOfVillages
%s
}
}
@ -73,10 +77,11 @@ func (ss *Servers) Browse(filter *models.ServerFilter, incl *ServerInclude) (*Se
query servers($filter: ServerFilter) {
servers(filter: $filter) {
items {
id
key
status
dataUpdatedAt
historyUpdatedAt
statsUpdatedAt
%s
}
total