This repository has been archived on 2022-09-04. You can view files and clone it, but cannot push or open issues or pull requests.
api/graphql/resolvers/helpers.go

17 lines
283 B
Go
Raw Normal View History

2020-06-04 15:45:56 +00:00
package resolvers
import "github.com/99designs/gqlgen/graphql"
func getServer(rctx *graphql.FieldContext) (string, bool) {
server := ""
ok := false
for rctx != nil {
server, ok = rctx.Args["server"].(string)
2020-06-04 15:45:56 +00:00
if ok {
break
}
rctx = rctx.Parent
2020-06-04 15:45:56 +00:00
}
return server, ok
}