Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var GQLGetIntKey = &graphql.Field{ Name: "GetIntKey", Type: kind.GQLIntKeyStateType, Description: "", Args: graphql.FieldConfigArgument{ "name": &graphql.ArgumentConfig{ Description: "Name", Type: graphql.NewNonNull(graphql.String), }, }, Resolve: func(p graphql.ResolveParams) (interface{}, error) { name := p.Args["name"].(string) ikc, ok := p.Source.(*intkey.Context) if !ok { return nil, nil } if !utility.HasReadPermission(ikc.AccessControl) { return nil, gqlerrors.NewFormattedError(x.ErrReadPermissionRequired.Error()) } intKeyState, err := ikc.Client.GetIntKeyState(name) if err != nil { return nil, gqlerrors.NewFormattedError(err.Error()) } return intKeyState, nil }, }
View Source
var GQLGetIntKeyList = &graphql.Field{ Name: "GetIntKeyList", Type: graphql.NewList(kind.GQLIntKeyStateType), Description: "", Args: graphql.FieldConfigArgument{ "nameList": &graphql.ArgumentConfig{ Description: "Name list", Type: graphql.NewNonNull(graphql.NewList(graphql.NewNonNull(graphql.String))), }, }, Resolve: func(p graphql.ResolveParams) (interface{}, error) { nameList := p.Args["nameList"].([]interface{}) ikc, ok := p.Source.(*intkey.Context) if !ok { return nil, nil } if !utility.HasReadPermission(ikc.AccessControl) { return nil, gqlerrors.NewFormattedError(x.ErrReadPermissionRequired.Error()) } intKeyStateList, err := ikc.Client.GetIntKeyStateList(nameList) if err != nil { return nil, gqlerrors.NewFormattedError(err.Error()) } return intKeyStateList, nil }, }
View Source
var GQLIntKeyTPType = graphql.NewObject(graphql.ObjectConfig{ Name: "IntKeyTP", Description: "Integer key transaction processor", Fields: graphql.Fields{ "getIntKey": GQLGetIntKey, "getIntKeyList": GQLGetIntKeyList, }, })
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.