1 Star 0 Fork 0

ryancartoon / sensu-go

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
Clone or Download
mutator.go 746 Bytes
Copy Edit Raw Blame History
package graphql
import (
v2 "github.com/sensu/sensu-go/api/core/v2"
"github.com/sensu/sensu-go/backend/apid/graphql/schema"
"github.com/sensu/sensu-go/graphql"
"github.com/sensu/sensu-go/types"
)
var _ schema.MutatorFieldResolvers = (*mutatorImpl)(nil)
//
// Implement MutatorFieldResolvers
//
type mutatorImpl struct {
schema.MutatorAliases
}
// IsTypeOf is used to determine if a given value is associated with the type
func (*mutatorImpl) IsTypeOf(s interface{}, p graphql.IsTypeOfParams) bool {
_, ok := s.(*types.Mutator)
return ok
}
// ToJSON implements response to request for 'toJSON' field.
func (*mutatorImpl) ToJSON(p graphql.ResolveParams) (interface{}, error) {
return types.WrapResource(p.Source.(v2.Resource)), nil
}
1
https://gitee.com/ryancartoon/sensu-go.git
git@gitee.com:ryancartoon/sensu-go.git
ryancartoon
sensu-go
sensu-go
v5.10.1

Search