identity_interface_graphql

package
v0.0.0-...-b31fe97 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AdminIdentityGraphQlModel = graphql.NewObject(graphql.ObjectConfig{
	Name:        "AdminIdentity",
	Description: "the administration identity",
	Fields: graphql.Fields{
		"UID": &graphql.Field{
			Type:        graphql.String,
			Description: "the unique ID of the identity",
			Resolve: func(p graphql.ResolveParams) (interface{}, error) {
				if obj, ok := p.Source.(*identity_models.Identity); ok {
					return obj.UID, nil
				}
				return nil, errors.New("can not cast UID object")
			},
		},
		"acceptConditionsAndPrivacy": &graphql.Field{
			Type:        graphql.Boolean,
			Description: "accept conditions and privacy",
			Resolve: func(p graphql.ResolveParams) (interface{}, error) {
				if obj, ok := p.Source.(*identity_models.Identity); ok {
					return obj.AcceptConditionsAndPrivacy, nil
				}
				return nil, errors.New("can not cast accept terms and conditions value")
			},
		},
		"active": &graphql.Field{
			Type:        graphql.Boolean,
			Description: "has activated the account through email",
			Resolve: func(p graphql.ResolveParams) (interface{}, error) {
				if obj, ok := p.Source.(*identity_models.Identity); ok {
					return obj.Active, nil
				}
				return nil, errors.New("can not cast active value")
			},
		},
		"cleared": &graphql.Field{
			Type:        graphql.Boolean,
			Description: "has been cleared by an admin or automatically depending on the settings",
			Resolve: func(p graphql.ResolveParams) (interface{}, error) {
				if obj, ok := p.Source.(*identity_models.Identity); ok {
					return obj.Cleared, nil
				}
				return nil, errors.New("can not cast cleared value")
			},
		},
		"blocked": &graphql.Field{
			Type:        graphql.Boolean,
			Description: "has been blocked by an admin",
			Resolve: func(p graphql.ResolveParams) (interface{}, error) {
				if obj, ok := p.Source.(*identity_models.Identity); ok {
					return obj.Blocked, nil
				}
				return nil, errors.New("can not cast blocked value")
			},
		},
		"createdAt": &graphql.Field{
			Type:        graphql.DateTime,
			Description: "the creation date of the identity",
			Resolve: func(p graphql.ResolveParams) (interface{}, error) {
				if obj, ok := p.Source.(*identity_models.Identity); ok {
					return obj.CreatedAt, nil
				}
				return nil, errors.New("can not cast created at timestamp")
			},
		},
		"deletedAt": &graphql.Field{
			Type:        graphql.DateTime,
			Description: "the deletion date of the identity",
			Resolve: func(p graphql.ResolveParams) (interface{}, error) {
				if obj, ok := p.Source.(*identity_models.Identity); ok {
					return obj.DeletedAt, nil
				}
				return nil, errors.New("can not cast deleted at timestamp")
			},
		},
		"updatedAt": &graphql.Field{
			Type:        graphql.DateTime,
			Description: "the update date of the identity",
			Resolve: func(p graphql.ResolveParams) (interface{}, error) {
				if obj, ok := p.Source.(*identity_models.Identity); ok {
					return obj.UpdatedAt, nil
				}
				return nil, errors.New("can not cast updated at timestamp")
			},
		},
		"salutation": &graphql.Field{
			Type:        graphql.String,
			Description: "the salutation of the identity",
			Resolve: func(p graphql.ResolveParams) (interface{}, error) {
				if obj, ok := p.Source.(*identity_models.Identity); ok {
					return obj.Salutation, nil
				}
				return nil, errors.New("can not cast salutation value")
			},
		},
		"firstName": &graphql.Field{
			Type:        graphql.String,
			Description: "the first name of the identity",
			Resolve: func(p graphql.ResolveParams) (interface{}, error) {
				if obj, ok := p.Source.(*identity_models.Identity); ok {
					return obj.FirstName, nil
				}
				return nil, errors.New("can not cast first name value")
			},
		},
		"lastName": &graphql.Field{
			Type:        graphql.String,
			Description: "the last name of the identity",
			Resolve: func(p graphql.ResolveParams) (interface{}, error) {
				if obj, ok := p.Source.(*identity_models.Identity); ok {
					return obj.LastName, nil
				}
				return nil, errors.New("can not cast last name value")
			},
		},
		"email": &graphql.Field{
			Type:        graphql.String,
			Description: "the email of the identity",
			Resolve: func(p graphql.ResolveParams) (interface{}, error) {
				if obj, ok := p.Source.(*identity_models.Identity); ok {
					return obj.Email, nil
				}
				return nil, errors.New("can not cast email object")
			},
		},
		"backupEmail": &graphql.Field{
			Type:        graphql.Int,
			Description: "the backup email of the identity",
			Resolve: func(p graphql.ResolveParams) (interface{}, error) {
				if obj, ok := p.Source.(*identity_models.Identity); ok {
					return obj.BackupEmail, nil
				}
				return nil, errors.New("can not cast backup email object")
			},
		},
		"phone": &graphql.Field{
			Type:        graphql.String,
			Description: "the phone number of the identity",
			Resolve: func(p graphql.ResolveParams) (interface{}, error) {
				if obj, ok := p.Source.(*identity_models.Identity); ok {
					return obj.Phone, nil
				}
				return nil, errors.New("can not cast phone object")
			},
		},
		"backupPhone": &graphql.Field{
			Type:        graphql.Int,
			Description: "the backup phone of the identity",
			Resolve: func(p graphql.ResolveParams) (interface{}, error) {
				if obj, ok := p.Source.(*identity_models.Identity); ok {
					return obj.BackupPhone, nil
				}
				return nil, errors.New("can not cast backup phone object")
			},
		},
	},
})

AdminIdentityGraphQlModel is the identity model for the GraphQL admin interface

View Source
var ApiTokenGraphQlModel = graphql.NewObject(graphql.ObjectConfig{
	Name:        "ApiToken",
	Description: "the API token of the identity",
	Fields: graphql.Fields{
		"UID": &graphql.Field{
			Type:        graphql.String,
			Description: "the unique ID of the identity",
			Resolve: func(p graphql.ResolveParams) (interface{}, error) {
				if obj, ok := p.Source.(*identity_models.IdentityApiToken); ok {
					return obj.UID, nil
				}
				return nil, errors.New("can not cast api token UID")
			},
		},
		"createdAt": &graphql.Field{
			Type:        graphql.DateTime,
			Description: "the creation date of the api token",
			Resolve: func(p graphql.ResolveParams) (interface{}, error) {
				if obj, ok := p.Source.(*identity_models.IdentityApiToken); ok {
					return obj.CreatedAt, nil
				}
				return nil, errors.New("can not cast api token creation date")
			},
		},
		"name": &graphql.Field{
			Type:        graphql.String,
			Description: "the name of the api token",
			Resolve: func(p graphql.ResolveParams) (interface{}, error) {
				if obj, ok := p.Source.(*identity_models.IdentityApiToken); ok {
					return obj.Name, nil
				}
				return nil, errors.New("can not cast api token name")
			},
		},
		"token": &graphql.Field{
			Type:        graphql.String,
			Description: "the name of the api token",
			Resolve: func(p graphql.ResolveParams) (interface{}, error) {
				if obj, ok := p.Source.(*identity_models.IdentityApiToken); ok {
					return obj.Token, nil
				}
				return nil, errors.New("can not cast api token")
			},
		},
		"expirationDate": &graphql.Field{
			Type:        graphql.DateTime,
			Description: "the expiration dat of the api token",
			Resolve: func(p graphql.ResolveParams) (interface{}, error) {
				if obj, ok := p.Source.(*identity_models.IdentityApiToken); ok {
					return obj.ExpirationDate, nil
				}
				return nil, errors.New("can not cast api token expiration date")
			},
		},
	},
})

ApiTokenGraphQlModel is the graphql model for the api token

View Source
var ErrAgentFromContext = errors.New("can not extract user agent from context")

ErrAgentFromContext is returned when the user agent is not found in the context

View Source
var ErrInvalidUid = errors.New("can not parse uid from arguments")

ErrInvalidUid is returned when the uid is invalid

View Source
var ErrIpFromContext = errors.New("can not extract ip from context")

ErrIpFromContext is returned when the user ip is not found in the context

View Source
var ErrOriginFromContext = errors.New("can not extract origin from context")

ErrOriginFromContext is returned when the origin is not found in the context

View Source
var ErrUserIdFromContext = errors.New("can not get IDENTITY_UID from context")

ErrUserIdFromContext is returned when the user id is not found in the context

View Source
var IdentitiesPaginationGraphQlModel = graphql.NewObject(graphql.ObjectConfig{
	Name:        "Identities",
	Description: "An identities result object",
	Fields: graphql.Fields{
		"results": &graphql.Field{
			Type:        graphql.NewList(AdminIdentityGraphQlModel),
			Description: "list of identities",
			Resolve: func(p graphql.ResolveParams) (interface{}, error) {
				if obj, ok := p.Source.(*IdentitiesPaginationDTO); ok {
					return obj.Results, nil
				}
				return nil, errors.New("can not cast object")
			},
		},
		"amount": &graphql.Field{
			Type:        graphql.Int,
			Description: "the total amount of identities",
			Resolve: func(p graphql.ResolveParams) (interface{}, error) {
				if obj, ok := p.Source.(*IdentitiesPaginationDTO); ok {
					return obj.Amount, nil
				}
				return nil, errors.New("can not cast object")
			},
		},
	},
})

IdentitiesPaginationGraphQlModel is the graphql model for the identities pagination

View Source
var IdentityGraphQlModel = graphql.NewObject(graphql.ObjectConfig{
	Name:        "Identity",
	Description: "the identity",
	Fields: graphql.Fields{
		"UID": &graphql.Field{
			Type:        graphql.String,
			Description: "the unique ID of the identity",
			Resolve: func(p graphql.ResolveParams) (interface{}, error) {
				if obj, ok := p.Source.(*identity_models.Identity); ok {
					return obj.UID, nil
				}
				return nil, errors.New("can not cast UID object")
			},
		},
		"createdAt": &graphql.Field{
			Type:        graphql.DateTime,
			Description: "the creation date of the identity",
			Resolve: func(p graphql.ResolveParams) (interface{}, error) {
				if obj, ok := p.Source.(*identity_models.Identity); ok {
					return obj.CreatedAt, nil
				}
				return nil, errors.New("can not cast UID object")
			},
		},
		"salutation": &graphql.Field{
			Type:        graphql.String,
			Description: "the salutation of the identity",
			Resolve: func(p graphql.ResolveParams) (interface{}, error) {
				if obj, ok := p.Source.(*identity_models.Identity); ok {
					return obj.Salutation, nil
				}
				return nil, errors.New("can not cast email object")
			},
		},
		"firstName": &graphql.Field{
			Type:        graphql.String,
			Description: "the first name of the identity",
			Resolve: func(p graphql.ResolveParams) (interface{}, error) {
				if obj, ok := p.Source.(*identity_models.Identity); ok {
					return obj.FirstName, nil
				}
				return nil, errors.New("can not cast email object")
			},
		},
		"lastName": &graphql.Field{
			Type:        graphql.String,
			Description: "the last name of the identity",
			Resolve: func(p graphql.ResolveParams) (interface{}, error) {
				if obj, ok := p.Source.(*identity_models.Identity); ok {
					return obj.LastName, nil
				}
				return nil, errors.New("can not cast email object")
			},
		},
		"email": &graphql.Field{
			Type:        graphql.String,
			Description: "the email of the identity",
			Resolve: func(p graphql.ResolveParams) (interface{}, error) {
				if obj, ok := p.Source.(*identity_models.Identity); ok {
					return obj.Email, nil
				}
				return nil, errors.New("can not cast email object")
			},
		},
		"backupEmail": &graphql.Field{
			Type:        graphql.Int,
			Description: "the backup email of the identity",
			Resolve: func(p graphql.ResolveParams) (interface{}, error) {
				if obj, ok := p.Source.(*identity_models.Identity); ok {
					return obj.BackupEmail, nil
				}
				return nil, errors.New("can not cast backupEmail object")
			},
		},
		"phone": &graphql.Field{
			Type:        graphql.String,
			Description: "the phone number of the identity",
			Resolve: func(p graphql.ResolveParams) (interface{}, error) {
				if obj, ok := p.Source.(*identity_models.Identity); ok {
					return obj.Phone, nil
				}
				return nil, errors.New("can not cast phone object")
			},
		},
		"backupPhone": &graphql.Field{
			Type:        graphql.Int,
			Description: "the backup phone of the identity",
			Resolve: func(p graphql.ResolveParams) (interface{}, error) {
				if obj, ok := p.Source.(*identity_models.Identity); ok {
					return obj.BackupPhone, nil
				}
				return nil, errors.New("can not cast backupPhone object")
			},
		},
	},
})

IdentityGraphQlModel is the identity model for the GraphQL interface

View Source
var IdentityMutationObject = graphql.NewInputObject(graphql.InputObjectConfig{
	Name: "IdentityMutationObject",
	Fields: graphql.InputObjectConfigFieldMap{
		"UID": &graphql.InputObjectFieldConfig{
			Type: graphql.String,
		},
		"salutation": &graphql.InputObjectFieldConfig{
			Type: graphql.String,
		},
		"firstName": &graphql.InputObjectFieldConfig{
			Type: graphql.String,
		},
		"lastName": &graphql.InputObjectFieldConfig{
			Type: graphql.String,
		},
		"email": &graphql.InputObjectFieldConfig{
			Type: graphql.String,
		},
		"backupEmail": &graphql.InputObjectFieldConfig{
			Type: graphql.String,
		},
		"phone": &graphql.InputObjectFieldConfig{
			Type: graphql.String,
		},
		"backupPhone": &graphql.InputObjectFieldConfig{
			Type: graphql.String,
		},
	},
})
View Source
var LoginAttemptGraphQlModel = graphql.NewObject(graphql.ObjectConfig{
	Name:        "LoginAttempt",
	Description: "the login attempt of identities",
	Fields: graphql.Fields{
		"UID": &graphql.Field{
			Type:        graphql.String,
			Description: "the unique ID of the identity",
			Resolve: func(p graphql.ResolveParams) (interface{}, error) {
				if obj, ok := p.Source.(*identity_models.IdentityLogin); ok {
					return obj.UID, nil
				}
				return nil, errors.New("can not cast login attempt UID")
			},
		},
		"createdAt": &graphql.Field{
			Type:        graphql.DateTime,
			Description: "the creation date of the login attempt",
			Resolve: func(p graphql.ResolveParams) (interface{}, error) {
				if obj, ok := p.Source.(*identity_models.IdentityLogin); ok {
					return obj.CreatedAt, nil
				}
				return nil, errors.New("can not cast login attempt creation date")
			},
		},
		"email": &graphql.Field{
			Type:        graphql.String,
			Description: "the name of the login attempt",
			Resolve: func(p graphql.ResolveParams) (interface{}, error) {
				if obj, ok := p.Source.(*identity_models.IdentityLogin); ok {
					return obj.Email, nil
				}
				return nil, errors.New("can not cast login attempt email")
			},
		},
		"origin": &graphql.Field{
			Type:        graphql.String,
			Description: "the origin of the login attempt",
			Resolve: func(p graphql.ResolveParams) (interface{}, error) {
				if obj, ok := p.Source.(*identity_models.IdentityLogin); ok {
					return obj.Origin, nil
				}
				return nil, errors.New("can not cast login attempt origin")
			},
		},
		"userAgent": &graphql.Field{
			Type:        graphql.String,
			Description: "the user agent of the login attempt",
			Resolve: func(p graphql.ResolveParams) (interface{}, error) {
				if obj, ok := p.Source.(*identity_models.IdentityLogin); ok {
					return obj.UserAgent, nil
				}
				return nil, errors.New("can not cast login attempt user agent")
			},
		},
		"ip": &graphql.Field{
			Type:        graphql.String,
			Description: "the ip of the login attempt",
			Resolve: func(p graphql.ResolveParams) (interface{}, error) {
				if obj, ok := p.Source.(*identity_models.IdentityLogin); ok {
					return obj.IP, nil
				}
				return nil, errors.New("can not cast login attempt ip")
			},
		},
		"identityUID": &graphql.Field{
			Type:        graphql.String,
			Description: "the identity UID of the login attempt",
			Resolve: func(p graphql.ResolveParams) (interface{}, error) {
				if obj, ok := p.Source.(*identity_models.IdentityLogin); ok {
					return obj.IdentityUID, nil
				}
				return nil, errors.New("can not cast login attempt identity UID")
			},
		},
		"success": &graphql.Field{
			Type:        graphql.Boolean,
			Description: "the success of the login attempt",
			Resolve: func(p graphql.ResolveParams) (interface{}, error) {
				if obj, ok := p.Source.(*identity_models.IdentityLogin); ok {
					if obj.IdentityUID == nil {
						return false, nil
					}
					return *obj.IdentityUID != uuid.Nil, nil
				}
				return nil, errors.New("can not cast login attempt identity UID")
			},
		},
	},
})

LoginAttemptGraphQlModel is the graphql model for the login attempts

View Source
var LoginAttemptsPaginationGraphQlModel = graphql.NewObject(graphql.ObjectConfig{
	Name:        "LoginAttemptsField",
	Description: "Login attempts pagination",
	Fields: graphql.Fields{
		"results": &graphql.Field{
			Type:        graphql.NewList(LoginAttemptGraphQlModel),
			Description: "list of login attempts",
			Resolve: func(p graphql.ResolveParams) (interface{}, error) {
				if obj, ok := p.Source.(*LoginAttemptsPaginationDTO); ok {
					return obj.Results, nil
				}
				return nil, errors.New("can not cast object")
			},
		},
		"amount": &graphql.Field{
			Type:        graphql.Int,
			Description: "the total amount of projects",
			Resolve: func(p graphql.ResolveParams) (interface{}, error) {
				if obj, ok := p.Source.(*LoginAttemptsPaginationDTO); ok {
					return obj.Amount, nil
				}
				return nil, errors.New("can not cast object")
			},
		},
	},
})

LoginAttemptsPaginationGraphQlModel is the graphql model for the login attempts pagination

Functions

func AdminActivateIdentity

func AdminActivateIdentity(service identity_controllers.IdentityService) *graphql.Field

AdminActivateIdentity is a GraphQL mutation to activate a user

func AdminBlockIdentity

func AdminBlockIdentity(service identity_controllers.IdentityService) *graphql.Field

AdminBlockIdentity is a GraphQL mutation to block a user

func AdminCreateIdentityAndInviteField

func AdminCreateIdentityAndInviteField(service identity_controllers.IdentityService) *graphql.Field

AdminCreateIdentityAndInviteField is the graphql field to create and invite a new user

func AdminDeleteIdentity

func AdminDeleteIdentity(service identity_controllers.IdentityService) *graphql.Field

AdminDeleteIdentity is a GraphQL mutation to delete a user

func AdminInviteField

func AdminInviteField(service identity_controllers.IdentityService) *graphql.Field

AdminInviteField is the graphql field to invite a new user sends an email to the user with a link to the registration page

func AdminLockIdentity

func AdminLockIdentity(service identity_controllers.IdentityService) *graphql.Field

AdminLockIdentity is a GraphQL mutation to lock an identity

func AdminUnBlockIdentity

func AdminUnBlockIdentity(service identity_controllers.IdentityService) *graphql.Field

AdminUnBlockIdentity is a GraphQL mutation to unblock a user

func AdminUnlockIdentity

func AdminUnlockIdentity(service identity_controllers.IdentityService) *graphql.Field

AdminUnlockIdentity is a GraphQL mutation to unlock an identity

func AnonymizeField

func AnonymizeField(service identity_controllers.IdentityService) *graphql.Field

AnonymizeField is the graphql field to anonymize an identity

func ApiTokensField

func ApiTokensField(service identity_controllers.IdentityService) *graphql.Field

ApiTokensField is the graphql field for the api tokens

func ChangePasswordField

func ChangePasswordField(service identity_controllers.IdentityService) *graphql.Field

ChangePasswordField is the graphql field for change password

func CheckAdmin

func CheckAdmin(service identity_controllers.IdentityService, p *graphql.ResolveParams) (err error)

CheckAdmin checks if the user is admin

func ConfirmResetPasswordField

func ConfirmResetPasswordField(service identity_controllers.IdentityService) *graphql.Field

ConfirmResetPasswordField confirms the reset password flow

func CreateApiTokenField

func CreateApiTokenField(service identity_controllers.IdentityService) *graphql.Field

CreateApiTokenField is the graphql field to create a new api token

func CurrentIdentityField

func CurrentIdentityField(service identity_controllers.IdentityService) *graphql.Field

CurrentIdentityField is the graphql field that returns the current identity

func CurrentIdentityIsAdminField

func CurrentIdentityIsAdminField(service identity_controllers.IdentityService) *graphql.Field

CurrentIdentityIsAdminField is the graphql field that returns true if the current identity is an admin

func DeleteApiTokenField

func DeleteApiTokenField(service identity_controllers.IdentityService) *graphql.Field

DeleteApiTokenField is the graphql field for deleting an api token

func DeleteField

func DeleteField(service identity_controllers.IdentityService) *graphql.Field

DeleteField is the graphql field for deleting an identity

func GetIdentityUIDFromContext

func GetIdentityUIDFromContext(p *graphql.ResolveParams) (uid uuid.UUID, err error)

GetIdentityUIDFromContext returns the user id from the context

func GetIpFromContext

func GetIpFromContext(p *graphql.ResolveParams) (ip string, err error)

GetIpFromContext returns the user ip from the context

func GetOriginFromContext

func GetOriginFromContext(p *graphql.ResolveParams) (origin string, err error)

GetOriginFromContext returns the origin from the context

func GetUserAgentFromContext

func GetUserAgentFromContext(p *graphql.ResolveParams) (userAgent string, err error)

GetUserAgentFromContext returns the user agent from the context

func IdentitiesSearchField

func IdentitiesSearchField(service identity_controllers.IdentityService) *graphql.Field

IdentitiesSearchField is the graphql field for the search identities

func IdentityApiTokensField

func IdentityApiTokensField(service identity_controllers.IdentityService) *graphql.Field

IdentityApiTokensField is the graphql field for the api tokens of an identity

func IdentityField

func IdentityField(service identity_controllers.IdentityService) *graphql.Field

IdentityField is the graphql field for the identity

func InitResetPasswordField

func InitResetPasswordField(service identity_controllers.IdentityService) *graphql.Field

InitResetPasswordField initializes the reset password flow

func InvitationConfirmationField

func InvitationConfirmationField(service identity_controllers.IdentityService) *graphql.Field

InvitationConfirmationField is the graphql field to confirm an invitation

func LoginAttemptsField

func LoginAttemptsField(service identity_controllers.IdentityService) *graphql.Field

LoginAttemptsField is the graphql field for searching the logins

func LoginField

LoginField is the graphql field to log in a user

func ParseUIDFromArgs

func ParseUIDFromArgs(p *graphql.ResolveParams, key string) (uid uuid.UUID, err error)

ParseUIDFromArgs parses the uid from the context

func RegistrationConfirmationField

func RegistrationConfirmationField(service identity_controllers.IdentityService) *graphql.Field

func UpdateIdentityField

func UpdateIdentityField(service identity_controllers.IdentityService) *graphql.Field

Types

type AdminMutations

type AdminMutations struct {
	AdminInvite                  *graphql.Field
	AdminCreateIdentityAndInvite *graphql.Field
	AdminBlockIdentity           *graphql.Field
	AdminUnblockIdentity         *graphql.Field
	AdminLockIdentity            *graphql.Field
	AdminUnlockIdentity          *graphql.Field
	AdminDeleteIdentity          *graphql.Field
	AdminActivateIdentity        *graphql.Field
	// TODO: implement
	AdminResetEmail     *graphql.Field
	AdminUpdateIdentity *graphql.Field
	AdminResetPassword  *graphql.Field
}

AdminMutations is a struct that holds all the admin mutations

func InitAdminGraphQlMutations

func InitAdminGraphQlMutations(service identity_controllers.IdentityService) *AdminMutations

InitAdminGraphQlMutations initializes the admin mutations

func (*AdminMutations) GenerateMutationObjects

func (gql *AdminMutations) GenerateMutationObjects(root *graphql.Object)

GenerateMutationObjects generates the mutation objects

type AdminQueries

type AdminQueries struct {
	SearchIdentities  *graphql.Field
	Identity          *graphql.Field
	LoginAttempts     *graphql.Field
	IdentityApiTokens *graphql.Field
}

func InitAdminGraphQlQueries

func InitAdminGraphQlQueries(service identity_controllers.IdentityService) *AdminQueries

func (*AdminQueries) GenerateQueryObjects

func (gql *AdminQueries) GenerateQueryObjects(root *graphql.Object)

type IdentitiesPaginationDTO

type IdentitiesPaginationDTO struct {
	Amount  int64
	Results []*identity_models.Identity
}

IdentitiesPaginationDTO is the dto for the identities pagination

type LoginAttemptsPaginationDTO

type LoginAttemptsPaginationDTO struct {
	Results []*identity_models.IdentityLogin `json:"results"`
	Amount  int64                            `json:"amount"`
}

LoginAttemptsPaginationDTO is the data transfer object for the login attempts pagination

type Mutations

type Mutations struct {
	Login                    *graphql.Field
	Register                 *graphql.Field
	RegistrationConfirmation *graphql.Field
	UpdateIdentity           *graphql.Field
	ChangePassword           *graphql.Field
	InitResetPassword        *graphql.Field
	ConfirmResetPassword     *graphql.Field
	DeleteIdentity           *graphql.Field
	AnonymizeIdentity        *graphql.Field
	CreateApiToken           *graphql.Field
	DeleteApiToken           *graphql.Field
	InvitationConfirmation   *graphql.Field
}

Mutations is a struct that holds all the mutations

func InitGraphQlMutations

func InitGraphQlMutations(service identity_controllers.IdentityService) *Mutations

func (*Mutations) GenerateMutationObjects

func (gql *Mutations) GenerateMutationObjects(root *graphql.Object)

type Queries

type Queries struct {
	CurrentIdentity             *graphql.Field
	ApiTokens                   *graphql.Field
	CurrentIdentityIsAdminField *graphql.Field
}

Queries is a struct containing all the graphql queries

func InitGraphQlQueries

func InitGraphQlQueries(service identity_controllers.IdentityService) *Queries

InitGraphQlQueries initializes the graphql queries

func (*Queries) GenerateQueryObjects

func (gql *Queries) GenerateQueryObjects(root *graphql.Object)

GenerateQueryObjects generates the query objects

Jump to

Keyboard shortcuts

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