|
|
@ -30,11 +30,61 @@ func GQLVexListAlliance() * graphql.List {
|
|
|
|
|
|
|
|
|
|
|
|
func GQLVexMatchAlliances(p graphql.ResolveParams) (interface{}, error) {
|
|
|
|
func GQLVexMatchAlliances(p graphql.ResolveParams) (interface{}, error) {
|
|
|
|
return GQLEventFn(p, func(event Event, p graphql.ResolveParams) (interface{}, error) {
|
|
|
|
return GQLEventFn(p, func(event Event, p graphql.ResolveParams) (interface{}, error) {
|
|
|
|
//TODO improve
|
|
|
|
|
|
|
|
return event.(*Match).alliances, nil
|
|
|
|
return event.(*Match).alliances, nil
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func GQLVexMatchArena(p graphql.ResolveParams) (interface{}, error) {
|
|
|
|
|
|
|
|
return GQLEventFn(p, func(event Event, p graphql.ResolveParams) (interface{}, error) {
|
|
|
|
|
|
|
|
return event.(*Match).arena, nil
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func GQLVexAllianceTeams(p graphql.ResolveParams) (interface{}, error) {
|
|
|
|
|
|
|
|
return GQLResourceFn(p, func(resource Resource, p graphql.ResolveParams) (interface{}, error) {
|
|
|
|
|
|
|
|
return resource.(*Alliance).teams, nil
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var gql_vex_type_arena * graphql.Object = nil
|
|
|
|
|
|
|
|
func GQLVexTypeArena() * graphql.Object {
|
|
|
|
|
|
|
|
if gql_vex_type_arena == nil {
|
|
|
|
|
|
|
|
gql_vex_type_arena = graphql.NewObject(graphql.ObjectConfig{
|
|
|
|
|
|
|
|
Name: "Arena",
|
|
|
|
|
|
|
|
Interfaces: []*graphql.Interface{
|
|
|
|
|
|
|
|
GQLInterfaceResource(),
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
IsTypeOf: func(p graphql.IsTypeOfParams) bool {
|
|
|
|
|
|
|
|
_, ok := p.Value.(Arena)
|
|
|
|
|
|
|
|
return ok
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
Fields: graphql.Fields{},
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
gql_vex_type_arena.AddFieldConfig("ID", &graphql.Field{
|
|
|
|
|
|
|
|
Type: graphql.String,
|
|
|
|
|
|
|
|
Resolve: GQLResourceID,
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
gql_vex_type_arena.AddFieldConfig("Name", &graphql.Field{
|
|
|
|
|
|
|
|
Type: graphql.String,
|
|
|
|
|
|
|
|
Resolve: GQLResourceName,
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
gql_vex_type_arena.AddFieldConfig("Description", &graphql.Field{
|
|
|
|
|
|
|
|
Type: graphql.String,
|
|
|
|
|
|
|
|
Resolve: GQLResourceDescription,
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
gql_vex_type_arena.AddFieldConfig("Parents", &graphql.Field{
|
|
|
|
|
|
|
|
Type: GQLListResource(),
|
|
|
|
|
|
|
|
Resolve: GQLResourceParents,
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return gql_vex_type_arena
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var gql_vex_type_match * graphql.Object = nil
|
|
|
|
var gql_vex_type_match * graphql.Object = nil
|
|
|
|
func GQLVexTypeMatch() * graphql.Object {
|
|
|
|
func GQLVexTypeMatch() * graphql.Object {
|
|
|
|
if gql_vex_type_match == nil {
|
|
|
|
if gql_vex_type_match == nil {
|
|
|
@ -74,6 +124,11 @@ func GQLVexTypeMatch() * graphql.Object {
|
|
|
|
Type: GQLVexListAlliance(),
|
|
|
|
Type: GQLVexListAlliance(),
|
|
|
|
Resolve: GQLVexMatchAlliances,
|
|
|
|
Resolve: GQLVexMatchAlliances,
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
gql_vex_type_match.AddFieldConfig("Arena", &graphql.Field{
|
|
|
|
|
|
|
|
Type: GQLVexTypeArena(),
|
|
|
|
|
|
|
|
Resolve: GQLVexMatchArena,
|
|
|
|
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return gql_vex_type_match
|
|
|
|
return gql_vex_type_match
|
|
|
@ -93,7 +148,6 @@ func GQLVexTypeAlliance() * graphql.Object {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
Fields: graphql.Fields{},
|
|
|
|
Fields: graphql.Fields{},
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
gql_vex_type_alliance.AddFieldConfig("ID", &graphql.Field{
|
|
|
|
gql_vex_type_alliance.AddFieldConfig("ID", &graphql.Field{
|
|
|
|
Type: graphql.String,
|
|
|
|
Type: graphql.String,
|
|
|
@ -115,6 +169,12 @@ func GQLVexTypeAlliance() * graphql.Object {
|
|
|
|
Resolve: GQLResourceParents,
|
|
|
|
Resolve: GQLResourceParents,
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
gql_vex_type_alliance.AddFieldConfig("Teams", &graphql.Field{
|
|
|
|
|
|
|
|
Type: GQLVexListTeam(),
|
|
|
|
|
|
|
|
Resolve: GQLVexAllianceTeams,
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return gql_vex_type_alliance
|
|
|
|
return gql_vex_type_alliance
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|