bump github.com/tribalwarshelp/shared, add a new field to the Player GraphQL model (LastActivityAt)

This commit is contained in:
Dawid Wysokiński 2021-01-09 15:05:16 +01:00
parent 95768c7dc2
commit 3c7531a5ac
4 changed files with 105 additions and 3 deletions

2
go.mod
View File

@ -16,7 +16,7 @@ require (
github.com/modern-go/reflect2 v1.0.1 // indirect
github.com/pkg/errors v0.9.1
github.com/tribalwarshelp/map-generator v0.0.0-20210106163923-fa048a59f5f2
github.com/tribalwarshelp/shared v0.0.0-20210108165451-75051c5e0455
github.com/tribalwarshelp/shared v0.0.0-20210109140005-237443e96235
github.com/vektah/gqlparser/v2 v2.1.0
golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208
)

4
go.sum
View File

@ -184,8 +184,8 @@ github.com/tribalwarshelp/map-generator v0.0.0-20210106163923-fa048a59f5f2 h1:yY
github.com/tribalwarshelp/map-generator v0.0.0-20210106163923-fa048a59f5f2/go.mod h1:ywyp0CZ3JsJ+0GAbUJVWo3dipHcAohD7KkV2TNbiTHU=
github.com/tribalwarshelp/shared v0.0.0-20210106162314-d3488036ca2f h1:E8ahQd4yo3nB0eJMpL/M0s6iZaWMGmxga14kiqsHcQ4=
github.com/tribalwarshelp/shared v0.0.0-20210106162314-d3488036ca2f/go.mod h1:vtDs7EjEysk4dpFPfu3c4lkICXZYIRV0BrT7rsqG0dw=
github.com/tribalwarshelp/shared v0.0.0-20210108165451-75051c5e0455 h1:084v0jO7MXHxl3uh+6vxCBc0WcAATm6rA2SShenbOxI=
github.com/tribalwarshelp/shared v0.0.0-20210108165451-75051c5e0455/go.mod h1:vtDs7EjEysk4dpFPfu3c4lkICXZYIRV0BrT7rsqG0dw=
github.com/tribalwarshelp/shared v0.0.0-20210109140005-237443e96235 h1:VMc5zgClXx9IPMK4ttyVpElrOr4dWZ/gKMlASzpiuzA=
github.com/tribalwarshelp/shared v0.0.0-20210109140005-237443e96235/go.mod h1:vtDs7EjEysk4dpFPfu3c4lkICXZYIRV0BrT7rsqG0dw=
github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo=
github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw=
github.com/ugorji/go/codec v1.1.7 h1:2SvQaVZ1ouYrrKKwoSk2pzd4A9evlKJb9oTL+OaLUSs=

View File

@ -191,6 +191,7 @@ type ComplexityRoot struct {
Exists func(childComplexity int) int
ID func(childComplexity int) int
JoinedAt func(childComplexity int) int
LastActivityAt func(childComplexity int) int
MostPoints func(childComplexity int) int
MostPointsAt func(childComplexity int) int
MostVillages func(childComplexity int) int
@ -1344,6 +1345,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in
return e.complexity.Player.JoinedAt(childComplexity), true
case "Player.lastActivityAt":
if e.complexity.Player.LastActivityAt == nil {
break
}
return e.complexity.Player.LastActivityAt(childComplexity), true
case "Player.mostPoints":
if e.complexity.Player.MostPoints == nil {
break
@ -3672,6 +3680,7 @@ type Player {
mostVillages: Int!
mostVillagesAt: Time!
joinedAt: Time!
lastActivityAt: Time!
deletedAt: Time
tribe: Tribe @goField(forceResolver: true)
servers: [String!]! @goField(forceResolver: true)
@ -3772,6 +3781,12 @@ input PlayerFilter {
joinedAtLT: Time
joinedAtLTE: Time
lastActivityAt: Time
lastActivityAtGT: Time
lastActivityAtGTE: Time
lastActivityAtLT: Time
lastActivityAtLTE: Time
deletedAt: Time
deletedAtGT: Time
deletedAtGTE: Time
@ -9325,6 +9340,41 @@ func (ec *executionContext) _Player_joinedAt(ctx context.Context, field graphql.
return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res)
}
func (ec *executionContext) _Player_lastActivityAt(ctx context.Context, field graphql.CollectedField, obj *models.Player) (ret graphql.Marshaler) {
defer func() {
if r := recover(); r != nil {
ec.Error(ctx, ec.Recover(ctx, r))
ret = graphql.Null
}
}()
fc := &graphql.FieldContext{
Object: "Player",
Field: field,
Args: nil,
IsMethod: false,
IsResolver: false,
}
ctx = graphql.WithFieldContext(ctx, fc)
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) {
ctx = rctx // use context from middleware stack in children
return obj.LastActivityAt, nil
})
if err != nil {
ec.Error(ctx, err)
return graphql.Null
}
if resTmp == nil {
if !graphql.HasFieldError(ctx, fc) {
ec.Errorf(ctx, "must not be null")
}
return graphql.Null
}
res := resTmp.(time.Time)
fc.Result = res
return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res)
}
func (ec *executionContext) _Player_deletedAt(ctx context.Context, field graphql.CollectedField, obj *models.Player) (ret graphql.Marshaler) {
defer func() {
if r := recover(); r != nil {
@ -20743,6 +20793,46 @@ func (ec *executionContext) unmarshalInputPlayerFilter(ctx context.Context, obj
if err != nil {
return it, err
}
case "lastActivityAt":
var err error
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastActivityAt"))
it.LastActivityAt, err = ec.unmarshalOTime2timeᚐTime(ctx, v)
if err != nil {
return it, err
}
case "lastActivityAtGT":
var err error
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastActivityAtGT"))
it.LastActivityAtGT, err = ec.unmarshalOTime2timeᚐTime(ctx, v)
if err != nil {
return it, err
}
case "lastActivityAtGTE":
var err error
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastActivityAtGTE"))
it.LastActivityAtGTE, err = ec.unmarshalOTime2timeᚐTime(ctx, v)
if err != nil {
return it, err
}
case "lastActivityAtLT":
var err error
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastActivityAtLT"))
it.LastActivityAtLT, err = ec.unmarshalOTime2timeᚐTime(ctx, v)
if err != nil {
return it, err
}
case "lastActivityAtLTE":
var err error
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lastActivityAtLTE"))
it.LastActivityAtLTE, err = ec.unmarshalOTime2timeᚐTime(ctx, v)
if err != nil {
return it, err
}
case "deletedAt":
var err error
@ -23184,6 +23274,11 @@ func (ec *executionContext) _Player(ctx context.Context, sel ast.SelectionSet, o
if out.Values[i] == graphql.Null {
atomic.AddUint32(&invalids, 1)
}
case "lastActivityAt":
out.Values[i] = ec._Player_lastActivityAt(ctx, field, obj)
if out.Values[i] == graphql.Null {
atomic.AddUint32(&invalids, 1)
}
case "deletedAt":
out.Values[i] = ec._Player_deletedAt(ctx, field, obj)
case "tribe":

View File

@ -27,6 +27,7 @@ type Player {
mostVillages: Int!
mostVillagesAt: Time!
joinedAt: Time!
lastActivityAt: Time!
deletedAt: Time
tribe: Tribe @goField(forceResolver: true)
servers: [String!]! @goField(forceResolver: true)
@ -127,6 +128,12 @@ input PlayerFilter {
joinedAtLT: Time
joinedAtLTE: Time
lastActivityAt: Time
lastActivityAtGT: Time
lastActivityAtGTE: Time
lastActivityAtLT: Time
lastActivityAtLTE: Time
deletedAt: Time
deletedAtGT: Time
deletedAtGTE: Time