Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var GetDateTimeQuery = &graphql.Field{ Type: graphql.String, Description: "Get Date Time of server", Resolve: func(params graphql.ResolveParams) (interface{}, error) { return time.Now().Format(time.RFC3339), nil }, }
View Source
var LoginTQuery = &graphql.Field{ Type: types.UserType, Description: "Login User by nick and password", Resolve: func(params graphql.ResolveParams) (interface{}, error) { user := params.Context.Value("current").(ms.Values).Get("currentUser").(interface{}) use, err := services.LoginT(user.(services.UserTkn).Id) if err != nil { return nil, err } return *use, nil }, }
View Source
var ModulesQuery = &graphql.Field{ Type: graphql.NewList(types.ModuleType), Description: "Get all Modules", Resolve: func(params graphql.ResolveParams) (interface{}, error) { if errPerm := secServices.ValidatePermissionToOperation(params); errPerm != nil { return nil, errPerm } modules, err := services.GetModules() defer secServices.AddOperationAudit(params, "", "", err) if err != nil { return nil, err } return *modules, nil }, }
View Source
var OperationsQuery = &graphql.Field{ Type: graphql.NewList(types.OperationType), Description: "Get all Operations", Resolve: func(params graphql.ResolveParams) (interface{}, error) { if errPerm := secServices.ValidatePermissionToOperation(params); errPerm != nil { return nil, errPerm } operations, err := services.GetOperations() defer secServices.AddOperationAudit(params, "", "", err) if err != nil { return nil, err } return *operations, err }, }
View Source
var UserQuery = &graphql.Field{ Type: types.UserType, Description: "Get user", Args: graphql.FieldConfigArgument{ "dni": &graphql.ArgumentConfig{ Type: graphql.NewNonNull(graphql.String), }, }, Resolve: func(params graphql.ResolveParams) (interface{}, error) { dni, _ := params.Args["dni"].(string) user, err := services.GetUserByDNI(dni) if err != nil { return nil, err } return *user, nil }, }
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.