types

package
v0.0.0-...-f501c68 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 7, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AuditEventType = graphql.NewObject(graphql.ObjectConfig{
	Name: "AuditEvent",
	Fields: graphql.Fields{
		"id": &graphql.Field{
			Type: graphql.String,
			Resolve: func(p graphql.ResolveParams) (interface{}, error) {
				auditEvent, _ := p.Source.(models.AuditEvent)
				return auditEvent.Id.Hex(), nil
			},
		},
		"user": &graphql.Field{
			Type: adminTypes.UserType,
			Resolve: func(p graphql.ResolveParams) (interface{}, error) {
				auditEvent, _ := p.Source.(models.AuditEvent)
				user, err := adminServices.GetUserById(auditEvent.User)
				if err != nil {
					return nil, nil
				}
				return *user, nil
			},
		},
		"ipLocal": &graphql.Field{
			Type: graphql.String,
		},
		"ipRemote": &graphql.Field{
			Type: graphql.String,
		},
		"agent": &graphql.Field{
			Type: graphql.String,
		},
		"auth": &graphql.Field{
			Type: graphql.String,
		},
		"token": &graphql.Field{
			Type: graphql.String,
		},
		"consult": &graphql.Field{
			Type: graphql.String,
		},
		"operations": &graphql.Field{
			Type: graphql.NewList(OperationAuditType),
		},
	},
})
View Source
var OperationAuditType = graphql.NewObject(graphql.ObjectConfig{
	Name: "OperationAudit",
	Fields: graphql.Fields{
		"id": &graphql.Field{
			Type: graphql.String,
			Resolve: func(p graphql.ResolveParams) (interface{}, error) {
				operationAudit, _ := p.Source.(models.OperationAudit)
				return operationAudit.Id.Hex(), nil
			},
		},
		"operation": &graphql.Field{
			Type: adminTypes.OperationType,
			Resolve: func(p graphql.ResolveParams) (interface{}, error) {
				operationAudit, _ := p.Source.(models.OperationAudit)
				return adminServices.GetOperationByID(operationAudit.Operation)
			},
		},
		"permission": &graphql.Field{
			Type: graphql.Boolean,
		},
		"nowStruct": &graphql.Field{
			Type: graphql.String,
		},
		"newStruct": &graphql.Field{
			Type: graphql.String,
		},
		"error": &graphql.Field{
			Type: graphql.String,
		},
		"result": &graphql.Field{
			Type: graphql.Boolean,
		},
		"timeB": &graphql.Field{
			Type: graphql.String,
		},
		"timeE": &graphql.Field{
			Type: graphql.String,
		},
	},
})

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL