gen

package
v0.0.0-...-69f632e Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2020 License: MIT Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KeyPrincipalID         key    = iota
	KeyLoaders             key    = iota
	KeyExecutableSchema    key    = iota
	KeyJWTClaims           key    = iota
	KeyMutationTransaction key    = iota
	KeyMutationEvents      key    = iota
	SchemaSDL              string = `` /* 5671-byte string literal not displayed */

)

Variables

Functions

func AddMutationEvent

func AddMutationEvent(ctx context.Context, e events.Event)

func ApplyChanges

func ApplyChanges(changes map[string]interface{}, to interface{}) error

used to convert map[string]interface{} to EntityChanges struct

func DeleteAllSurveyAnswersHandler

func DeleteAllSurveyAnswersHandler(ctx context.Context, r *GeneratedResolver) (bool, error)

func DeleteAllSurveysHandler

func DeleteAllSurveysHandler(ctx context.Context, r *GeneratedResolver) (bool, error)

func EnrichContextWithMutations

func EnrichContextWithMutations(ctx context.Context, r *GeneratedResolver) context.Context

func FinishMutationContext

func FinishMutationContext(ctx context.Context, r *GeneratedResolver) (err error)

func GetHTTPServeMux

func GetHTTPServeMux(r ResolverRoot, db *DB) *http.ServeMux

func GetItem

func GetItem(ctx context.Context, db *gorm.DB, out interface{}, id *string) error

func GetItemForRelation

func GetItemForRelation(ctx context.Context, db *gorm.DB, obj interface{}, relation string, out interface{}) error

func GetLoaders

func GetLoaders(db *DB) map[string]*dataloader.Loader

func GetPrincipalIDFromContext

func GetPrincipalIDFromContext(ctx context.Context) *string

func GetTransaction

func GetTransaction(ctx context.Context) *gorm.DB

func Marshal_Any

func Marshal_Any(v interface{}) graphql.Marshaler

func NewExecutableSchema

func NewExecutableSchema(cfg Config) graphql.ExecutableSchema

NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface.

func TableName

func TableName(name string) string

func Unmarshal_Any

func Unmarshal_Any(v interface{}) (interface{}, error)

Types

type ComplexityRoot

type ComplexityRoot struct {
	Mutation struct {
		CreateSurvey           func(childComplexity int, input map[string]interface{}) int
		CreateSurveyAnswer     func(childComplexity int, input map[string]interface{}) int
		DeleteAllSurveyAnswers func(childComplexity int) int
		DeleteAllSurveys       func(childComplexity int) int
		DeleteSurvey           func(childComplexity int, id string) int
		DeleteSurveyAnswer     func(childComplexity int, id string) int
		UpdateSurvey           func(childComplexity int, id string, input map[string]interface{}) int
		UpdateSurveyAnswer     func(childComplexity int, id string, input map[string]interface{}) int
	}

	Query struct {
		Survey        func(childComplexity int, id *string, q *string, filter *SurveyFilterType) int
		SurveyAnswer  func(childComplexity int, id *string, q *string, filter *SurveyAnswerFilterType) int
		SurveyAnswers func(childComplexity int, offset *int, limit *int, q *string, sort []*SurveyAnswerSortType, filter *SurveyAnswerFilterType) int
		SurveyExport  func(childComplexity int, filter *SurveyExportFilterType) int
		Surveys       func(childComplexity int, offset *int, limit *int, q *string, sort []*SurveySortType, filter *SurveyFilterType) int
		// contains filtered or unexported fields
	}

	Survey struct {
		Answers    func(childComplexity int) int
		AnswersIds func(childComplexity int) int
		Content    func(childComplexity int) int
		CreatedAt  func(childComplexity int) int
		CreatedBy  func(childComplexity int) int
		ID         func(childComplexity int) int
		Name       func(childComplexity int) int
		UpdatedAt  func(childComplexity int) int
		UpdatedBy  func(childComplexity int) int
	}

	SurveyAnswer struct {
		Completed func(childComplexity int) int
		Content   func(childComplexity int) int
		CreatedAt func(childComplexity int) int
		CreatedBy func(childComplexity int) int
		ID        func(childComplexity int) int
		Survey    func(childComplexity int) int
		SurveyID  func(childComplexity int) int
		UpdatedAt func(childComplexity int) int
		UpdatedBy func(childComplexity int) int
	}

	SurveyAnswerResultType struct {
		Count func(childComplexity int) int
		Items func(childComplexity int) int
	}

	SurveyExport struct {
		Items func(childComplexity int) int
	}

	SurveyExportField struct {
		Key   func(childComplexity int) int
		Title func(childComplexity int) int
	}

	SurveyExportItem struct {
		Fields func(childComplexity int) int
		Rows   func(childComplexity int) int
		Survey func(childComplexity int) int
	}

	SurveyExportRow struct {
		Answer func(childComplexity int) int
		Values func(childComplexity int) int
	}

	SurveyExportValue struct {
		Key   func(childComplexity int) int
		Value func(childComplexity int) int
	}

	SurveyResultType struct {
		Count func(childComplexity int) int
		Items func(childComplexity int) int
	}
	// contains filtered or unexported fields
}

type Config

type Config struct {
	Resolvers  ResolverRoot
	Directives DirectiveRoot
	Complexity ComplexityRoot
}

type DB

type DB struct {
	// contains filtered or unexported fields
}

DB ...

func NewDB

func NewDB(db *gorm.DB) *DB

NewDB ...

func NewDBFromEnvVars

func NewDBFromEnvVars() *DB

NewDBFromEnvVars Create database client using DATABASE_URL environment variable

func NewDBWithString

func NewDBWithString(urlString string) *DB

NewDBWithString creates database instance with database URL string

func (*DB) AutoMigrate

func (db *DB) AutoMigrate() *gorm.DB

AutoMigrate ...

func (*DB) Close

func (db *DB) Close() error

Close ...

func (*DB) Ping

func (db *DB) Ping() error

func (*DB) Query

func (db *DB) Query() *gorm.DB

Query ...

type DirectiveRoot

type DirectiveRoot struct {
}

type EntityFilter

type EntityFilter interface {
	Apply(ctx context.Context, dialect gorm.Dialect, wheres *[]string, values *[]interface{}, joins *[]string) error
}

type EntityFilterQuery

type EntityFilterQuery interface {
	Apply(ctx context.Context, dialect gorm.Dialect, selectionSet *ast.SelectionSet, wheres *[]string, values *[]interface{}, joins *[]string) error
}

type EntityResultType

type EntityResultType struct {
	Offset       *int
	Limit        *int
	Query        EntityFilterQuery
	Sort         []EntitySort
	Filter       EntityFilter
	Fields       []*ast.Field
	SelectionSet *ast.SelectionSet
}

func (*EntityResultType) GetCount

func (r *EntityResultType) GetCount(ctx context.Context, db *gorm.DB, out interface{}) (count int, err error)

GetCount ...

func (*EntityResultType) GetItems

func (r *EntityResultType) GetItems(ctx context.Context, db *gorm.DB, opts GetItemsOptions, out interface{}) error

GetResultTypeItems ...

func (*EntityResultType) GetSortStrings

func (r *EntityResultType) GetSortStrings() []string

type EntitySort

type EntitySort interface {
	Apply(ctx context.Context, dialect gorm.Dialect, sorts *[]string, joins *[]string) error
}

type GeneratedMutationResolver

type GeneratedMutationResolver struct{ *GeneratedResolver }

func (*GeneratedMutationResolver) CreateSurvey

func (r *GeneratedMutationResolver) CreateSurvey(ctx context.Context, input map[string]interface{}) (item *Survey, err error)

func (*GeneratedMutationResolver) CreateSurveyAnswer

func (r *GeneratedMutationResolver) CreateSurveyAnswer(ctx context.Context, input map[string]interface{}) (item *SurveyAnswer, err error)

func (*GeneratedMutationResolver) DeleteAllSurveyAnswers

func (r *GeneratedMutationResolver) DeleteAllSurveyAnswers(ctx context.Context) (bool, error)

func (*GeneratedMutationResolver) DeleteAllSurveys

func (r *GeneratedMutationResolver) DeleteAllSurveys(ctx context.Context) (bool, error)

func (*GeneratedMutationResolver) DeleteSurvey

func (r *GeneratedMutationResolver) DeleteSurvey(ctx context.Context, id string) (item *Survey, err error)

func (*GeneratedMutationResolver) DeleteSurveyAnswer

func (r *GeneratedMutationResolver) DeleteSurveyAnswer(ctx context.Context, id string) (item *SurveyAnswer, err error)

func (*GeneratedMutationResolver) UpdateSurvey

func (r *GeneratedMutationResolver) UpdateSurvey(ctx context.Context, id string, input map[string]interface{}) (item *Survey, err error)

func (*GeneratedMutationResolver) UpdateSurveyAnswer

func (r *GeneratedMutationResolver) UpdateSurveyAnswer(ctx context.Context, id string, input map[string]interface{}) (item *SurveyAnswer, err error)

type GeneratedQueryResolver

type GeneratedQueryResolver struct{ *GeneratedResolver }

func (*GeneratedQueryResolver) Survey

func (r *GeneratedQueryResolver) Survey(ctx context.Context, id *string, q *string, filter *SurveyFilterType) (*Survey, error)

func (*GeneratedQueryResolver) SurveyAnswer

func (r *GeneratedQueryResolver) SurveyAnswer(ctx context.Context, id *string, q *string, filter *SurveyAnswerFilterType) (*SurveyAnswer, error)

func (*GeneratedQueryResolver) SurveyAnswers

func (r *GeneratedQueryResolver) SurveyAnswers(ctx context.Context, offset *int, limit *int, q *string, sort []*SurveyAnswerSortType, filter *SurveyAnswerFilterType) (*SurveyAnswerResultType, error)

func (*GeneratedQueryResolver) Surveys

func (r *GeneratedQueryResolver) Surveys(ctx context.Context, offset *int, limit *int, q *string, sort []*SurveySortType, filter *SurveyFilterType) (*SurveyResultType, error)

type GeneratedResolver

type GeneratedResolver struct {
	Handlers        ResolutionHandlers
	DB              *DB
	EventController *events.EventController
}

type GeneratedSurveyAnswerResolver

type GeneratedSurveyAnswerResolver struct{ *GeneratedResolver }

func (*GeneratedSurveyAnswerResolver) Survey

func (r *GeneratedSurveyAnswerResolver) Survey(ctx context.Context, obj *SurveyAnswer) (res *Survey, err error)

type GeneratedSurveyAnswerResultTypeResolver

type GeneratedSurveyAnswerResultTypeResolver struct{ *GeneratedResolver }

func (*GeneratedSurveyAnswerResultTypeResolver) Count

func (*GeneratedSurveyAnswerResultTypeResolver) Items

type GeneratedSurveyResolver

type GeneratedSurveyResolver struct{ *GeneratedResolver }

func (*GeneratedSurveyResolver) Answers

func (r *GeneratedSurveyResolver) Answers(ctx context.Context, obj *Survey) (res []*SurveyAnswer, err error)

func (*GeneratedSurveyResolver) AnswersIds

func (r *GeneratedSurveyResolver) AnswersIds(ctx context.Context, obj *Survey) (ids []string, err error)

type GeneratedSurveyResultTypeResolver

type GeneratedSurveyResultTypeResolver struct{ *GeneratedResolver }

func (*GeneratedSurveyResultTypeResolver) Count

func (*GeneratedSurveyResultTypeResolver) Items

func (r *GeneratedSurveyResultTypeResolver) Items(ctx context.Context, obj *SurveyResultType) (items []*Survey, err error)

type GetItemsOptions

type GetItemsOptions struct {
	Alias      string
	Preloaders []string
}

type JWTClaims

type JWTClaims struct {
	jwtgo.StandardClaims
	Scope *string
}

func GetJWTClaimsFromContext

func GetJWTClaimsFromContext(ctx context.Context) *JWTClaims

func (*JWTClaims) HasScope

func (c *JWTClaims) HasScope(scope string) bool

func (*JWTClaims) Scopes

func (c *JWTClaims) Scopes() []string

type MutationEvents

type MutationEvents struct {
	Events []events.Event
}

func GetMutationEventStore

func GetMutationEventStore(ctx context.Context) *MutationEvents

type MutationResolver

type MutationResolver interface {
	CreateSurvey(ctx context.Context, input map[string]interface{}) (*Survey, error)
	UpdateSurvey(ctx context.Context, id string, input map[string]interface{}) (*Survey, error)
	DeleteSurvey(ctx context.Context, id string) (*Survey, error)
	DeleteAllSurveys(ctx context.Context) (bool, error)
	CreateSurveyAnswer(ctx context.Context, input map[string]interface{}) (*SurveyAnswer, error)
	UpdateSurveyAnswer(ctx context.Context, id string, input map[string]interface{}) (*SurveyAnswer, error)
	DeleteSurveyAnswer(ctx context.Context, id string) (*SurveyAnswer, error)
	DeleteAllSurveyAnswers(ctx context.Context) (bool, error)
}

type NotFoundError

type NotFoundError struct {
	Entity string
}

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

type ObjectSortType

type ObjectSortType string
const (
	ObjectSortTypeAsc  ObjectSortType = "ASC"
	ObjectSortTypeDesc ObjectSortType = "DESC"
)

func (ObjectSortType) IsValid

func (e ObjectSortType) IsValid() bool

func (ObjectSortType) MarshalGQL

func (e ObjectSortType) MarshalGQL(w io.Writer)

func (ObjectSortType) String

func (e ObjectSortType) String() string

func (*ObjectSortType) UnmarshalGQL

func (e *ObjectSortType) UnmarshalGQL(v interface{}) error

type QueryResolver

type QueryResolver interface {
	Survey(ctx context.Context, id *string, q *string, filter *SurveyFilterType) (*Survey, error)
	Surveys(ctx context.Context, offset *int, limit *int, q *string, sort []*SurveySortType, filter *SurveyFilterType) (*SurveyResultType, error)
	SurveyAnswer(ctx context.Context, id *string, q *string, filter *SurveyAnswerFilterType) (*SurveyAnswer, error)
	SurveyAnswers(ctx context.Context, offset *int, limit *int, q *string, sort []*SurveyAnswerSortType, filter *SurveyAnswerFilterType) (*SurveyAnswerResultType, error)
	SurveyExport(ctx context.Context, filter *SurveyExportFilterType) (*SurveyExport, error)
	// contains filtered or unexported methods
}

type QuerySurveyAnswerHandlerOptions

type QuerySurveyAnswerHandlerOptions struct {
	ID     *string
	Q      *string
	Filter *SurveyAnswerFilterType
}

type QuerySurveyAnswersHandlerOptions

type QuerySurveyAnswersHandlerOptions struct {
	Offset *int
	Limit  *int
	Q      *string
	Sort   []*SurveyAnswerSortType
	Filter *SurveyAnswerFilterType
}

type QuerySurveyHandlerOptions

type QuerySurveyHandlerOptions struct {
	ID     *string
	Q      *string
	Filter *SurveyFilterType
}

type QuerySurveysHandlerOptions

type QuerySurveysHandlerOptions struct {
	Offset *int
	Limit  *int
	Q      *string
	Sort   []*SurveySortType
	Filter *SurveyFilterType
}

type ResolutionHandlers

type ResolutionHandlers struct {
	OnEvent func(ctx context.Context, r *GeneratedResolver, e *events.Event) error

	CreateSurvey     func(ctx context.Context, r *GeneratedResolver, input map[string]interface{}) (item *Survey, err error)
	UpdateSurvey     func(ctx context.Context, r *GeneratedResolver, id string, input map[string]interface{}) (item *Survey, err error)
	DeleteSurvey     func(ctx context.Context, r *GeneratedResolver, id string) (item *Survey, err error)
	DeleteAllSurveys func(ctx context.Context, r *GeneratedResolver) (bool, error)
	QuerySurvey      func(ctx context.Context, r *GeneratedResolver, opts QuerySurveyHandlerOptions) (*Survey, error)
	QuerySurveys     func(ctx context.Context, r *GeneratedResolver, opts QuerySurveysHandlerOptions) (*SurveyResultType, error)

	SurveyAnswers func(ctx context.Context, r *GeneratedResolver, obj *Survey) (res []*SurveyAnswer, err error)

	CreateSurveyAnswer     func(ctx context.Context, r *GeneratedResolver, input map[string]interface{}) (item *SurveyAnswer, err error)
	UpdateSurveyAnswer     func(ctx context.Context, r *GeneratedResolver, id string, input map[string]interface{}) (item *SurveyAnswer, err error)
	DeleteSurveyAnswer     func(ctx context.Context, r *GeneratedResolver, id string) (item *SurveyAnswer, err error)
	DeleteAllSurveyAnswers func(ctx context.Context, r *GeneratedResolver) (bool, error)
	QuerySurveyAnswer      func(ctx context.Context, r *GeneratedResolver, opts QuerySurveyAnswerHandlerOptions) (*SurveyAnswer, error)
	QuerySurveyAnswers     func(ctx context.Context, r *GeneratedResolver, opts QuerySurveyAnswersHandlerOptions) (*SurveyAnswerResultType, error)

	SurveyAnswerSurvey func(ctx context.Context, r *GeneratedResolver, obj *SurveyAnswer) (res *Survey, err error)
}

func DefaultResolutionHandlers

func DefaultResolutionHandlers() ResolutionHandlers

type ResolverRoot

type ResolverRoot interface {
	Mutation() MutationResolver
	Query() QueryResolver
	Survey() SurveyResolver
	SurveyAnswer() SurveyAnswerResolver
	SurveyAnswerResultType() SurveyAnswerResultTypeResolver
	SurveyResultType() SurveyResultTypeResolver
}

type Survey

type Survey struct {
	ID        string     `json:"id" gorm:"column:id;primary_key"`
	Name      *string    `json:"name" gorm:"column:name"`
	Content   *string    `json:"content" gorm:"column:content;type:text"`
	UpdatedAt *time.Time `json:"updatedAt" gorm:"column:updatedAt"`
	CreatedAt time.Time  `json:"createdAt" gorm:"column:createdAt"`
	UpdatedBy *string    `json:"updatedBy" gorm:"column:updatedBy"`
	CreatedBy *string    `json:"createdBy" gorm:"column:createdBy"`

	Answers []*SurveyAnswer `json:"answers" gorm:"foreignkey:SurveyID"`
}

func CreateSurveyHandler

func CreateSurveyHandler(ctx context.Context, r *GeneratedResolver, input map[string]interface{}) (item *Survey, err error)

func DeleteSurveyHandler

func DeleteSurveyHandler(ctx context.Context, r *GeneratedResolver, id string) (item *Survey, err error)

func SurveyAnswerSurveyHandler

func SurveyAnswerSurveyHandler(ctx context.Context, r *GeneratedResolver, obj *SurveyAnswer) (res *Survey, err error)

func UpdateSurveyHandler

func UpdateSurveyHandler(ctx context.Context, r *GeneratedResolver, id string, input map[string]interface{}) (item *Survey, err error)

func (*Survey) Is_Entity

func (m *Survey) Is_Entity()

type SurveyAnswer

type SurveyAnswer struct {
	ID        string     `json:"id" gorm:"column:id;primary_key"`
	Completed *bool      `json:"completed" gorm:"column:completed"`
	Content   *string    `json:"content" gorm:"column:content;type:text"`
	SurveyID  *string    `json:"surveyId" gorm:"column:surveyId"`
	UpdatedAt *time.Time `json:"updatedAt" gorm:"column:updatedAt"`
	CreatedAt time.Time  `json:"createdAt" gorm:"column:createdAt"`
	UpdatedBy *string    `json:"updatedBy" gorm:"column:updatedBy"`
	CreatedBy *string    `json:"createdBy" gorm:"column:createdBy"`

	Survey *Survey `json:"survey"`
}

func CreateSurveyAnswerHandler

func CreateSurveyAnswerHandler(ctx context.Context, r *GeneratedResolver, input map[string]interface{}) (item *SurveyAnswer, err error)

func DeleteSurveyAnswerHandler

func DeleteSurveyAnswerHandler(ctx context.Context, r *GeneratedResolver, id string) (item *SurveyAnswer, err error)

func SurveyAnswersHandler

func SurveyAnswersHandler(ctx context.Context, r *GeneratedResolver, obj *Survey) (res []*SurveyAnswer, err error)

func UpdateSurveyAnswerHandler

func UpdateSurveyAnswerHandler(ctx context.Context, r *GeneratedResolver, id string, input map[string]interface{}) (item *SurveyAnswer, err error)

func (*SurveyAnswer) Is_Entity

func (m *SurveyAnswer) Is_Entity()

type SurveyAnswerChanges

type SurveyAnswerChanges struct {
	ID        string
	Completed *bool
	Content   *string
	SurveyID  *string
	UpdatedAt *time.Time
	CreatedAt time.Time
	UpdatedBy *string
	CreatedBy *string
}

type SurveyAnswerFilterType

type SurveyAnswerFilterType struct {
	And           []*SurveyAnswerFilterType `json:"AND"`
	Or            []*SurveyAnswerFilterType `json:"OR"`
	ID            *string                   `json:"id"`
	IDNe          *string                   `json:"id_ne"`
	IDGt          *string                   `json:"id_gt"`
	IDLt          *string                   `json:"id_lt"`
	IDGte         *string                   `json:"id_gte"`
	IDLte         *string                   `json:"id_lte"`
	IDIn          []string                  `json:"id_in"`
	IDNull        *bool                     `json:"id_null"`
	Completed     *bool                     `json:"completed"`
	CompletedNe   *bool                     `json:"completed_ne"`
	CompletedGt   *bool                     `json:"completed_gt"`
	CompletedLt   *bool                     `json:"completed_lt"`
	CompletedGte  *bool                     `json:"completed_gte"`
	CompletedLte  *bool                     `json:"completed_lte"`
	CompletedIn   []bool                    `json:"completed_in"`
	CompletedNull *bool                     `json:"completed_null"`
	Content       *string                   `json:"content"`
	ContentNe     *string                   `json:"content_ne"`
	ContentGt     *string                   `json:"content_gt"`
	ContentLt     *string                   `json:"content_lt"`
	ContentGte    *string                   `json:"content_gte"`
	ContentLte    *string                   `json:"content_lte"`
	ContentIn     []string                  `json:"content_in"`
	ContentLike   *string                   `json:"content_like"`
	ContentPrefix *string                   `json:"content_prefix"`
	ContentSuffix *string                   `json:"content_suffix"`
	ContentNull   *bool                     `json:"content_null"`
	SurveyID      *string                   `json:"surveyId"`
	SurveyIDNe    *string                   `json:"surveyId_ne"`
	SurveyIDGt    *string                   `json:"surveyId_gt"`
	SurveyIDLt    *string                   `json:"surveyId_lt"`
	SurveyIDGte   *string                   `json:"surveyId_gte"`
	SurveyIDLte   *string                   `json:"surveyId_lte"`
	SurveyIDIn    []string                  `json:"surveyId_in"`
	SurveyIDNull  *bool                     `json:"surveyId_null"`
	UpdatedAt     *time.Time                `json:"updatedAt"`
	UpdatedAtNe   *time.Time                `json:"updatedAt_ne"`
	UpdatedAtGt   *time.Time                `json:"updatedAt_gt"`
	UpdatedAtLt   *time.Time                `json:"updatedAt_lt"`
	UpdatedAtGte  *time.Time                `json:"updatedAt_gte"`
	UpdatedAtLte  *time.Time                `json:"updatedAt_lte"`
	UpdatedAtIn   []*time.Time              `json:"updatedAt_in"`
	UpdatedAtNull *bool                     `json:"updatedAt_null"`
	CreatedAt     *time.Time                `json:"createdAt"`
	CreatedAtNe   *time.Time                `json:"createdAt_ne"`
	CreatedAtGt   *time.Time                `json:"createdAt_gt"`
	CreatedAtLt   *time.Time                `json:"createdAt_lt"`
	CreatedAtGte  *time.Time                `json:"createdAt_gte"`
	CreatedAtLte  *time.Time                `json:"createdAt_lte"`
	CreatedAtIn   []*time.Time              `json:"createdAt_in"`
	CreatedAtNull *bool                     `json:"createdAt_null"`
	UpdatedBy     *string                   `json:"updatedBy"`
	UpdatedByNe   *string                   `json:"updatedBy_ne"`
	UpdatedByGt   *string                   `json:"updatedBy_gt"`
	UpdatedByLt   *string                   `json:"updatedBy_lt"`
	UpdatedByGte  *string                   `json:"updatedBy_gte"`
	UpdatedByLte  *string                   `json:"updatedBy_lte"`
	UpdatedByIn   []string                  `json:"updatedBy_in"`
	UpdatedByNull *bool                     `json:"updatedBy_null"`
	CreatedBy     *string                   `json:"createdBy"`
	CreatedByNe   *string                   `json:"createdBy_ne"`
	CreatedByGt   *string                   `json:"createdBy_gt"`
	CreatedByLt   *string                   `json:"createdBy_lt"`
	CreatedByGte  *string                   `json:"createdBy_gte"`
	CreatedByLte  *string                   `json:"createdBy_lte"`
	CreatedByIn   []string                  `json:"createdBy_in"`
	CreatedByNull *bool                     `json:"createdBy_null"`
	Survey        *SurveyFilterType         `json:"survey"`
}

func (*SurveyAnswerFilterType) AndWith

AndWith convenience method for combining two or more filters with AND statement

func (*SurveyAnswerFilterType) Apply

func (f *SurveyAnswerFilterType) Apply(ctx context.Context, dialect gorm.Dialect, wheres *[]string, values *[]interface{}, joins *[]string) error

func (*SurveyAnswerFilterType) ApplyWithAlias

func (f *SurveyAnswerFilterType) ApplyWithAlias(ctx context.Context, dialect gorm.Dialect, alias string, wheres *[]string, values *[]interface{}, joins *[]string) error

func (*SurveyAnswerFilterType) IsEmpty

func (f *SurveyAnswerFilterType) IsEmpty(ctx context.Context, dialect gorm.Dialect) bool

func (*SurveyAnswerFilterType) OrWith

OrWith convenience method for combining two or more filters with OR statement

func (*SurveyAnswerFilterType) WhereContent

func (f *SurveyAnswerFilterType) WhereContent(dialect gorm.Dialect, aliasPrefix string) (conditions []string, values []interface{})

type SurveyAnswerQueryFilter

type SurveyAnswerQueryFilter struct {
	Query *string
}

func (*SurveyAnswerQueryFilter) Apply

func (qf *SurveyAnswerQueryFilter) Apply(ctx context.Context, dialect gorm.Dialect, selectionSet *ast.SelectionSet, wheres *[]string, values *[]interface{}, joins *[]string) error

type SurveyAnswerResolver

type SurveyAnswerResolver interface {
	Survey(ctx context.Context, obj *SurveyAnswer) (*Survey, error)
}

type SurveyAnswerResultType

type SurveyAnswerResultType struct {
	EntityResultType
}

type SurveyAnswerResultTypeResolver

type SurveyAnswerResultTypeResolver interface {
	Items(ctx context.Context, obj *SurveyAnswerResultType) ([]*SurveyAnswer, error)
	Count(ctx context.Context, obj *SurveyAnswerResultType) (int, error)
}

type SurveyAnswerSortType

type SurveyAnswerSortType struct {
	ID        *ObjectSortType `json:"id"`
	Completed *ObjectSortType `json:"completed"`
	Content   *ObjectSortType `json:"content"`
	SurveyID  *ObjectSortType `json:"surveyId"`
	UpdatedAt *ObjectSortType `json:"updatedAt"`
	CreatedAt *ObjectSortType `json:"createdAt"`
	UpdatedBy *ObjectSortType `json:"updatedBy"`
	CreatedBy *ObjectSortType `json:"createdBy"`
	Survey    *SurveySortType `json:"survey"`
}

func (SurveyAnswerSortType) Apply

func (s SurveyAnswerSortType) Apply(ctx context.Context, dialect gorm.Dialect, sorts *[]string, joins *[]string) error

func (SurveyAnswerSortType) ApplyWithAlias

func (s SurveyAnswerSortType) ApplyWithAlias(ctx context.Context, dialect gorm.Dialect, alias string, sorts *[]string, joins *[]string) error

type SurveyChanges

type SurveyChanges struct {
	ID        string
	Name      *string
	Content   *string
	UpdatedAt *time.Time
	CreatedAt time.Time
	UpdatedBy *string
	CreatedBy *string

	AnswersIDs []*string
}

type SurveyExport

type SurveyExport struct {
	Items []*SurveyExportItem `json:"items"`
}

type SurveyExportField

type SurveyExportField struct {
	Key   string  `json:"key"`
	Title *string `json:"title"`
}

type SurveyExportFilterType

type SurveyExportFilterType struct {
	SurveyID  *string  `json:"surveyID"`
	AnswerIDs []string `json:"answerIDs"`
}

type SurveyExportItem

type SurveyExportItem struct {
	Survey *Survey              `json:"survey"`
	Fields []*SurveyExportField `json:"fields"`
	Rows   []*SurveyExportRow   `json:"rows"`
}

type SurveyExportRow

type SurveyExportRow struct {
	Answer *SurveyAnswer        `json:"answer"`
	Values []*SurveyExportValue `json:"values"`
}

type SurveyExportValue

type SurveyExportValue struct {
	Key   string  `json:"key"`
	Value *string `json:"value"`
}

type SurveyFilterType

type SurveyFilterType struct {
	And           []*SurveyFilterType     `json:"AND"`
	Or            []*SurveyFilterType     `json:"OR"`
	ID            *string                 `json:"id"`
	IDNe          *string                 `json:"id_ne"`
	IDGt          *string                 `json:"id_gt"`
	IDLt          *string                 `json:"id_lt"`
	IDGte         *string                 `json:"id_gte"`
	IDLte         *string                 `json:"id_lte"`
	IDIn          []string                `json:"id_in"`
	IDNull        *bool                   `json:"id_null"`
	Name          *string                 `json:"name"`
	NameNe        *string                 `json:"name_ne"`
	NameGt        *string                 `json:"name_gt"`
	NameLt        *string                 `json:"name_lt"`
	NameGte       *string                 `json:"name_gte"`
	NameLte       *string                 `json:"name_lte"`
	NameIn        []string                `json:"name_in"`
	NameLike      *string                 `json:"name_like"`
	NamePrefix    *string                 `json:"name_prefix"`
	NameSuffix    *string                 `json:"name_suffix"`
	NameNull      *bool                   `json:"name_null"`
	Content       *string                 `json:"content"`
	ContentNe     *string                 `json:"content_ne"`
	ContentGt     *string                 `json:"content_gt"`
	ContentLt     *string                 `json:"content_lt"`
	ContentGte    *string                 `json:"content_gte"`
	ContentLte    *string                 `json:"content_lte"`
	ContentIn     []string                `json:"content_in"`
	ContentLike   *string                 `json:"content_like"`
	ContentPrefix *string                 `json:"content_prefix"`
	ContentSuffix *string                 `json:"content_suffix"`
	ContentNull   *bool                   `json:"content_null"`
	UpdatedAt     *time.Time              `json:"updatedAt"`
	UpdatedAtNe   *time.Time              `json:"updatedAt_ne"`
	UpdatedAtGt   *time.Time              `json:"updatedAt_gt"`
	UpdatedAtLt   *time.Time              `json:"updatedAt_lt"`
	UpdatedAtGte  *time.Time              `json:"updatedAt_gte"`
	UpdatedAtLte  *time.Time              `json:"updatedAt_lte"`
	UpdatedAtIn   []*time.Time            `json:"updatedAt_in"`
	UpdatedAtNull *bool                   `json:"updatedAt_null"`
	CreatedAt     *time.Time              `json:"createdAt"`
	CreatedAtNe   *time.Time              `json:"createdAt_ne"`
	CreatedAtGt   *time.Time              `json:"createdAt_gt"`
	CreatedAtLt   *time.Time              `json:"createdAt_lt"`
	CreatedAtGte  *time.Time              `json:"createdAt_gte"`
	CreatedAtLte  *time.Time              `json:"createdAt_lte"`
	CreatedAtIn   []*time.Time            `json:"createdAt_in"`
	CreatedAtNull *bool                   `json:"createdAt_null"`
	UpdatedBy     *string                 `json:"updatedBy"`
	UpdatedByNe   *string                 `json:"updatedBy_ne"`
	UpdatedByGt   *string                 `json:"updatedBy_gt"`
	UpdatedByLt   *string                 `json:"updatedBy_lt"`
	UpdatedByGte  *string                 `json:"updatedBy_gte"`
	UpdatedByLte  *string                 `json:"updatedBy_lte"`
	UpdatedByIn   []string                `json:"updatedBy_in"`
	UpdatedByNull *bool                   `json:"updatedBy_null"`
	CreatedBy     *string                 `json:"createdBy"`
	CreatedByNe   *string                 `json:"createdBy_ne"`
	CreatedByGt   *string                 `json:"createdBy_gt"`
	CreatedByLt   *string                 `json:"createdBy_lt"`
	CreatedByGte  *string                 `json:"createdBy_gte"`
	CreatedByLte  *string                 `json:"createdBy_lte"`
	CreatedByIn   []string                `json:"createdBy_in"`
	CreatedByNull *bool                   `json:"createdBy_null"`
	Answers       *SurveyAnswerFilterType `json:"answers"`
}

func (*SurveyFilterType) AndWith

AndWith convenience method for combining two or more filters with AND statement

func (*SurveyFilterType) Apply

func (f *SurveyFilterType) Apply(ctx context.Context, dialect gorm.Dialect, wheres *[]string, values *[]interface{}, joins *[]string) error

func (*SurveyFilterType) ApplyWithAlias

func (f *SurveyFilterType) ApplyWithAlias(ctx context.Context, dialect gorm.Dialect, alias string, wheres *[]string, values *[]interface{}, joins *[]string) error

func (*SurveyFilterType) IsEmpty

func (f *SurveyFilterType) IsEmpty(ctx context.Context, dialect gorm.Dialect) bool

func (*SurveyFilterType) OrWith

OrWith convenience method for combining two or more filters with OR statement

func (*SurveyFilterType) WhereContent

func (f *SurveyFilterType) WhereContent(dialect gorm.Dialect, aliasPrefix string) (conditions []string, values []interface{})

type SurveyQueryFilter

type SurveyQueryFilter struct {
	Query *string
}

func (*SurveyQueryFilter) Apply

func (qf *SurveyQueryFilter) Apply(ctx context.Context, dialect gorm.Dialect, selectionSet *ast.SelectionSet, wheres *[]string, values *[]interface{}, joins *[]string) error

type SurveyResolver

type SurveyResolver interface {
	Answers(ctx context.Context, obj *Survey) ([]*SurveyAnswer, error)

	AnswersIds(ctx context.Context, obj *Survey) ([]string, error)
}

type SurveyResultType

type SurveyResultType struct {
	EntityResultType
}

type SurveyResultTypeResolver

type SurveyResultTypeResolver interface {
	Items(ctx context.Context, obj *SurveyResultType) ([]*Survey, error)
	Count(ctx context.Context, obj *SurveyResultType) (int, error)
}

type SurveySortType

type SurveySortType struct {
	ID         *ObjectSortType       `json:"id"`
	Name       *ObjectSortType       `json:"name"`
	Content    *ObjectSortType       `json:"content"`
	UpdatedAt  *ObjectSortType       `json:"updatedAt"`
	CreatedAt  *ObjectSortType       `json:"createdAt"`
	UpdatedBy  *ObjectSortType       `json:"updatedBy"`
	CreatedBy  *ObjectSortType       `json:"createdBy"`
	AnswersIds *ObjectSortType       `json:"answersIds"`
	Answers    *SurveyAnswerSortType `json:"answers"`
}

func (SurveySortType) Apply

func (s SurveySortType) Apply(ctx context.Context, dialect gorm.Dialect, sorts *[]string, joins *[]string) error

func (SurveySortType) ApplyWithAlias

func (s SurveySortType) ApplyWithAlias(ctx context.Context, dialect gorm.Dialect, alias string, sorts *[]string, joins *[]string) error

Jump to

Keyboard shortcuts

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