Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var GQLGet = &graphql.Field{ Name: "Get", Type: kind.GQLJSONType, Description: "", Args: graphql.FieldConfigArgument{ "id": &graphql.ArgumentConfig{ Description: "ID", Type: graphql.NewNonNull(graphql.ID), }, }, Resolve: func(p graphql.ResolveParams) (interface{}, error) { id := p.Args["id"].(string) ikc, ok := p.Source.(*json.Context) if !ok { return nil, nil } if !utility.HasReadPermission(ikc.AccessControl) { return nil, gqlerrors.NewFormattedError(x.ErrReadPermissionRequired.Error()) } obj := make(map[string]interface{}) _, err := ikc.Client.Get(id, &obj) if err != nil { return nil, gqlerrors.NewFormattedError(err.Error()) } return obj, nil }, }
View Source
var GQLGetList = &graphql.Field{ Name: "GetList", Type: kind.GQLJSONType, Description: "", Args: graphql.FieldConfigArgument{ "idList": &graphql.ArgumentConfig{ Description: "List of id", Type: graphql.NewNonNull(graphql.NewList(graphql.NewNonNull(graphql.ID))), }, }, Resolve: func(p graphql.ResolveParams) (interface{}, error) { idList := p.Args["idList"].([]interface{}) ikc, ok := p.Source.(*json.Context) if !ok { return nil, nil } if !utility.HasReadPermission(ikc.AccessControl) { return nil, gqlerrors.NewFormattedError(x.ErrReadPermissionRequired.Error()) } obj, err := ikc.Client.GetList(idList) if err != nil { return nil, gqlerrors.NewFormattedError(err.Error()) } return obj, nil }, }
View Source
var GQLGetListByIndexID = &graphql.Field{ Name: "GetListByIndexID", Type: kind.GQLJSONType, Description: "", Args: graphql.FieldConfigArgument{ "idList": &graphql.ArgumentConfig{ Description: "List of index id", Type: graphql.NewNonNull(graphql.NewList(graphql.NewNonNull(graphql.String))), }, }, Resolve: func(p graphql.ResolveParams) (interface{}, error) { ids := p.Args["idList"].([]interface{}) ikc, ok := p.Source.(*json.Context) if !ok { return nil, nil } if !utility.HasReadPermission(ikc.AccessControl) { return nil, gqlerrors.NewFormattedError(x.ErrReadPermissionRequired.Error()) } obj, err := ikc.Client.GetListByIndexID(ids) if err != nil { return nil, gqlerrors.NewFormattedError(err.Error()) } return obj, nil }, }
View Source
var GQLJSONTPType = graphql.NewObject(graphql.ObjectConfig{ Name: "JSONTP", Description: "JSON transaction processor", Fields: graphql.Fields{ "get": GQLGet, "getList": GQLGetList, "getListByIndexID": GQLGetListByIndexID, }, })
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.