gen

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2019 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
	SchemaSDL           string = `` /* 6652-byte string literal not displayed */

)

Variables

Functions

func ApplyChanges

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

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

func DeleteAllChangelogChangesHandler

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

func DeleteAllChangelogsHandler

func DeleteAllChangelogsHandler(ctx context.Context, r *GeneratedResolver) (bool, 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 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 Changelog

type Changelog struct {
	ID          string        `json:"id" gorm:"column:id;primary_key"`
	Entity      string        `json:"entity" gorm:"column:entity;index:entity_search"`
	EntityID    string        `json:"entityID" gorm:"column:entityID;index:entity_search"`
	PrincipalID *string       `json:"principalID" gorm:"column:principalID"`
	Type        ChangelogType `json:"type" gorm:"column:type"`
	Date        time.Time     `json:"date" gorm:"column:date"`
	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"`

	Changes          []*ChangelogChange `json:"changes" gorm:"foreignkey:LogID"`
	ChangesPreloaded bool               `gorm:"-"`
}

func ChangelogChangeLogHandler

func ChangelogChangeLogHandler(ctx context.Context, r *GeneratedChangelogChangeResolver, obj *ChangelogChange) (res *Changelog, err error)

func CreateChangelogHandler

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

func DeleteChangelogHandler

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

func UpdateChangelogHandler

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

func (*Changelog) Is_Entity

func (m *Changelog) Is_Entity()

type ChangelogChange

type ChangelogChange struct {
	ID        string     `json:"id" gorm:"column:id;primary_key"`
	Column    string     `json:"column" gorm:"column:column"`
	OldValue  *string    `json:"oldValue" gorm:"column:oldValue;type:text"`
	NewValue  *string    `json:"newValue" gorm:"column:newValue;type:text"`
	LogID     *string    `json:"logId" gorm:"column:logId"`
	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"`

	Log *Changelog `json:"log"`
}

func ChangelogChangesHandler

func ChangelogChangesHandler(ctx context.Context, r *GeneratedChangelogResolver, obj *Changelog) (res []*ChangelogChange, err error)

func CreateChangelogChangeHandler

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

func DeleteChangelogChangeHandler

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

func UpdateChangelogChangeHandler

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

func (*ChangelogChange) Is_Entity

func (m *ChangelogChange) Is_Entity()

type ChangelogChangeChanges

type ChangelogChangeChanges struct {
	ID        string
	Column    string
	OldValue  *string
	NewValue  *string
	LogID     *string
	UpdatedAt *time.Time
	CreatedAt time.Time
	UpdatedBy *string
	CreatedBy *string
}

type ChangelogChangeFilterType

type ChangelogChangeFilterType struct {
	And            []*ChangelogChangeFilterType `json:"AND"`
	Or             []*ChangelogChangeFilterType `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"`
	Column         *string                      `json:"column"`
	ColumnNe       *string                      `json:"column_ne"`
	ColumnGt       *string                      `json:"column_gt"`
	ColumnLt       *string                      `json:"column_lt"`
	ColumnGte      *string                      `json:"column_gte"`
	ColumnLte      *string                      `json:"column_lte"`
	ColumnIn       []string                     `json:"column_in"`
	ColumnLike     *string                      `json:"column_like"`
	ColumnPrefix   *string                      `json:"column_prefix"`
	ColumnSuffix   *string                      `json:"column_suffix"`
	ColumnNull     *bool                        `json:"column_null"`
	OldValue       *string                      `json:"oldValue"`
	OldValueNe     *string                      `json:"oldValue_ne"`
	OldValueGt     *string                      `json:"oldValue_gt"`
	OldValueLt     *string                      `json:"oldValue_lt"`
	OldValueGte    *string                      `json:"oldValue_gte"`
	OldValueLte    *string                      `json:"oldValue_lte"`
	OldValueIn     []string                     `json:"oldValue_in"`
	OldValueLike   *string                      `json:"oldValue_like"`
	OldValuePrefix *string                      `json:"oldValue_prefix"`
	OldValueSuffix *string                      `json:"oldValue_suffix"`
	OldValueNull   *bool                        `json:"oldValue_null"`
	NewValue       *string                      `json:"newValue"`
	NewValueNe     *string                      `json:"newValue_ne"`
	NewValueGt     *string                      `json:"newValue_gt"`
	NewValueLt     *string                      `json:"newValue_lt"`
	NewValueGte    *string                      `json:"newValue_gte"`
	NewValueLte    *string                      `json:"newValue_lte"`
	NewValueIn     []string                     `json:"newValue_in"`
	NewValueLike   *string                      `json:"newValue_like"`
	NewValuePrefix *string                      `json:"newValue_prefix"`
	NewValueSuffix *string                      `json:"newValue_suffix"`
	NewValueNull   *bool                        `json:"newValue_null"`
	LogID          *string                      `json:"logId"`
	LogIDNe        *string                      `json:"logId_ne"`
	LogIDGt        *string                      `json:"logId_gt"`
	LogIDLt        *string                      `json:"logId_lt"`
	LogIDGte       *string                      `json:"logId_gte"`
	LogIDLte       *string                      `json:"logId_lte"`
	LogIDIn        []string                     `json:"logId_in"`
	LogIDNull      *bool                        `json:"logId_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"`
	Log            *ChangelogFilterType         `json:"log"`
}

func (*ChangelogChangeFilterType) AndWith

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

func (*ChangelogChangeFilterType) Apply

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

func (*ChangelogChangeFilterType) ApplyWithAlias

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

func (*ChangelogChangeFilterType) IsEmpty

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

func (*ChangelogChangeFilterType) OrWith

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

func (*ChangelogChangeFilterType) WhereContent

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

type ChangelogChangeQueryFilter

type ChangelogChangeQueryFilter struct {
	Query *string
}

func (*ChangelogChangeQueryFilter) Apply

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

type ChangelogChangeResolver

type ChangelogChangeResolver interface {
	Log(ctx context.Context, obj *ChangelogChange) (*Changelog, error)
}

type ChangelogChangeResultType

type ChangelogChangeResultType struct {
	EntityResultType
}

type ChangelogChangeResultTypeResolver

type ChangelogChangeResultTypeResolver interface {
	Items(ctx context.Context, obj *ChangelogChangeResultType) ([]*ChangelogChange, error)
	Count(ctx context.Context, obj *ChangelogChangeResultType) (int, error)
}

type ChangelogChangeSortType

type ChangelogChangeSortType struct {
	ID        *ObjectSortType    `json:"id"`
	Column    *ObjectSortType    `json:"column"`
	OldValue  *ObjectSortType    `json:"oldValue"`
	NewValue  *ObjectSortType    `json:"newValue"`
	LogID     *ObjectSortType    `json:"logId"`
	UpdatedAt *ObjectSortType    `json:"updatedAt"`
	CreatedAt *ObjectSortType    `json:"createdAt"`
	UpdatedBy *ObjectSortType    `json:"updatedBy"`
	CreatedBy *ObjectSortType    `json:"createdBy"`
	Log       *ChangelogSortType `json:"log"`
}

func (ChangelogChangeSortType) Apply

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

func (ChangelogChangeSortType) ApplyWithAlias

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

type ChangelogChanges

type ChangelogChanges struct {
	ID          string
	Entity      string
	EntityID    string
	PrincipalID *string
	Type        ChangelogType
	Date        time.Time
	UpdatedAt   *time.Time
	CreatedAt   time.Time
	UpdatedBy   *string
	CreatedBy   *string

	ChangesIDs []*string
}

type ChangelogFilterType

type ChangelogFilterType struct {
	And               []*ChangelogFilterType     `json:"AND"`
	Or                []*ChangelogFilterType     `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"`
	Entity            *string                    `json:"entity"`
	EntityNe          *string                    `json:"entity_ne"`
	EntityGt          *string                    `json:"entity_gt"`
	EntityLt          *string                    `json:"entity_lt"`
	EntityGte         *string                    `json:"entity_gte"`
	EntityLte         *string                    `json:"entity_lte"`
	EntityIn          []string                   `json:"entity_in"`
	EntityLike        *string                    `json:"entity_like"`
	EntityPrefix      *string                    `json:"entity_prefix"`
	EntitySuffix      *string                    `json:"entity_suffix"`
	EntityNull        *bool                      `json:"entity_null"`
	EntityID          *string                    `json:"entityID"`
	EntityIDNe        *string                    `json:"entityID_ne"`
	EntityIDGt        *string                    `json:"entityID_gt"`
	EntityIDLt        *string                    `json:"entityID_lt"`
	EntityIDGte       *string                    `json:"entityID_gte"`
	EntityIDLte       *string                    `json:"entityID_lte"`
	EntityIDIn        []string                   `json:"entityID_in"`
	EntityIDLike      *string                    `json:"entityID_like"`
	EntityIDPrefix    *string                    `json:"entityID_prefix"`
	EntityIDSuffix    *string                    `json:"entityID_suffix"`
	EntityIDNull      *bool                      `json:"entityID_null"`
	PrincipalID       *string                    `json:"principalID"`
	PrincipalIDNe     *string                    `json:"principalID_ne"`
	PrincipalIDGt     *string                    `json:"principalID_gt"`
	PrincipalIDLt     *string                    `json:"principalID_lt"`
	PrincipalIDGte    *string                    `json:"principalID_gte"`
	PrincipalIDLte    *string                    `json:"principalID_lte"`
	PrincipalIDIn     []string                   `json:"principalID_in"`
	PrincipalIDLike   *string                    `json:"principalID_like"`
	PrincipalIDPrefix *string                    `json:"principalID_prefix"`
	PrincipalIDSuffix *string                    `json:"principalID_suffix"`
	PrincipalIDNull   *bool                      `json:"principalID_null"`
	Type              *ChangelogType             `json:"type"`
	TypeNe            *ChangelogType             `json:"type_ne"`
	TypeGt            *ChangelogType             `json:"type_gt"`
	TypeLt            *ChangelogType             `json:"type_lt"`
	TypeGte           *ChangelogType             `json:"type_gte"`
	TypeLte           *ChangelogType             `json:"type_lte"`
	TypeIn            []ChangelogType            `json:"type_in"`
	TypeNull          *bool                      `json:"type_null"`
	Date              *time.Time                 `json:"date"`
	DateNe            *time.Time                 `json:"date_ne"`
	DateGt            *time.Time                 `json:"date_gt"`
	DateLt            *time.Time                 `json:"date_lt"`
	DateGte           *time.Time                 `json:"date_gte"`
	DateLte           *time.Time                 `json:"date_lte"`
	DateIn            []*time.Time               `json:"date_in"`
	DateNull          *bool                      `json:"date_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"`
	Changes           *ChangelogChangeFilterType `json:"changes"`
}

func (*ChangelogFilterType) AndWith

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

func (*ChangelogFilterType) Apply

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

func (*ChangelogFilterType) ApplyWithAlias

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

func (*ChangelogFilterType) IsEmpty

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

func (*ChangelogFilterType) OrWith

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

func (*ChangelogFilterType) WhereContent

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

type ChangelogQueryFilter

type ChangelogQueryFilter struct {
	Query *string
}

func (*ChangelogQueryFilter) Apply

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

type ChangelogResolver

type ChangelogResolver interface {
	Changes(ctx context.Context, obj *Changelog) ([]*ChangelogChange, error)

	ChangesIds(ctx context.Context, obj *Changelog) ([]string, error)
}

type ChangelogResultType

type ChangelogResultType struct {
	EntityResultType
}

type ChangelogResultTypeResolver

type ChangelogResultTypeResolver interface {
	Items(ctx context.Context, obj *ChangelogResultType) ([]*Changelog, error)
	Count(ctx context.Context, obj *ChangelogResultType) (int, error)
}

type ChangelogSortType

type ChangelogSortType struct {
	ID          *ObjectSortType          `json:"id"`
	Entity      *ObjectSortType          `json:"entity"`
	EntityID    *ObjectSortType          `json:"entityID"`
	PrincipalID *ObjectSortType          `json:"principalID"`
	Type        *ObjectSortType          `json:"type"`
	Date        *ObjectSortType          `json:"date"`
	UpdatedAt   *ObjectSortType          `json:"updatedAt"`
	CreatedAt   *ObjectSortType          `json:"createdAt"`
	UpdatedBy   *ObjectSortType          `json:"updatedBy"`
	CreatedBy   *ObjectSortType          `json:"createdBy"`
	ChangesIds  *ObjectSortType          `json:"changesIds"`
	Changes     *ChangelogChangeSortType `json:"changes"`
}

func (ChangelogSortType) Apply

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

func (ChangelogSortType) ApplyWithAlias

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

type ChangelogType

type ChangelogType string
const (
	ChangelogTypeCreated ChangelogType = "CREATED"
	ChangelogTypeUpdated ChangelogType = "UPDATED"
	ChangelogTypeDeleted ChangelogType = "DELETED"
)

func (ChangelogType) IsValid

func (e ChangelogType) IsValid() bool

func (ChangelogType) MarshalGQL

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

func (ChangelogType) String

func (e ChangelogType) String() string

func (*ChangelogType) UnmarshalGQL

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

type ComplexityRoot

type ComplexityRoot struct {
	Changelog struct {
		Changes     func(childComplexity int) int
		ChangesIds  func(childComplexity int) int
		CreatedAt   func(childComplexity int) int
		CreatedBy   func(childComplexity int) int
		Date        func(childComplexity int) int
		Entity      func(childComplexity int) int
		EntityID    func(childComplexity int) int
		ID          func(childComplexity int) int
		PrincipalID func(childComplexity int) int
		Type        func(childComplexity int) int
		UpdatedAt   func(childComplexity int) int
		UpdatedBy   func(childComplexity int) int
	}

	ChangelogChange struct {
		Column    func(childComplexity int) int
		CreatedAt func(childComplexity int) int
		CreatedBy func(childComplexity int) int
		ID        func(childComplexity int) int
		Log       func(childComplexity int) int
		LogID     func(childComplexity int) int
		NewValue  func(childComplexity int) int
		OldValue  func(childComplexity int) int
		UpdatedAt func(childComplexity int) int
		UpdatedBy func(childComplexity int) int
	}

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

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

	Mutation struct {
		CreateChangelog           func(childComplexity int, input map[string]interface{}) int
		CreateChangelogChange     func(childComplexity int, input map[string]interface{}) int
		DeleteAllChangelogChanges func(childComplexity int) int
		DeleteAllChangelogs       func(childComplexity int) int
		DeleteChangelog           func(childComplexity int, id string) int
		DeleteChangelogChange     func(childComplexity int, id string) int
		UpdateChangelog           func(childComplexity int, id string, input map[string]interface{}) int
		UpdateChangelogChange     func(childComplexity int, id string, input map[string]interface{}) int
	}

	Query struct {
		Changelog        func(childComplexity int, id *string, q *string, filter *ChangelogFilterType) int
		ChangelogChange  func(childComplexity int, id *string, q *string, filter *ChangelogChangeFilterType) int
		ChangelogChanges func(childComplexity int, offset *int, limit *int, q *string, sort []*ChangelogChangeSortType, filter *ChangelogChangeFilterType) int
		Changelogs       func(childComplexity int, offset *int, limit *int, q *string, sort []*ChangelogSortType, filter *ChangelogFilterType) int
		// contains filtered or unexported fields
	}
	// 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 GeneratedChangelogChangeResolver

type GeneratedChangelogChangeResolver struct{ *GeneratedResolver }

func (*GeneratedChangelogChangeResolver) Log

type GeneratedChangelogChangeResultTypeResolver

type GeneratedChangelogChangeResultTypeResolver struct{ *GeneratedResolver }

func (*GeneratedChangelogChangeResultTypeResolver) Count

func (*GeneratedChangelogChangeResultTypeResolver) Items

type GeneratedChangelogResolver

type GeneratedChangelogResolver struct{ *GeneratedResolver }

func (*GeneratedChangelogResolver) Changes

func (r *GeneratedChangelogResolver) Changes(ctx context.Context, obj *Changelog) (res []*ChangelogChange, err error)

func (*GeneratedChangelogResolver) ChangesIds

func (r *GeneratedChangelogResolver) ChangesIds(ctx context.Context, obj *Changelog) (ids []string, err error)

type GeneratedChangelogResultTypeResolver

type GeneratedChangelogResultTypeResolver struct{ *GeneratedResolver }

func (*GeneratedChangelogResultTypeResolver) Count

func (*GeneratedChangelogResultTypeResolver) Items

type GeneratedMutationResolver

type GeneratedMutationResolver struct{ *GeneratedResolver }

func (*GeneratedMutationResolver) CreateChangelog

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

func (*GeneratedMutationResolver) CreateChangelogChange

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

func (*GeneratedMutationResolver) DeleteAllChangelogChanges

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

func (*GeneratedMutationResolver) DeleteAllChangelogs

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

func (*GeneratedMutationResolver) DeleteChangelog

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

func (*GeneratedMutationResolver) DeleteChangelogChange

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

func (*GeneratedMutationResolver) UpdateChangelog

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

func (*GeneratedMutationResolver) UpdateChangelogChange

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

type GeneratedQueryResolver

type GeneratedQueryResolver struct{ *GeneratedResolver }

func (*GeneratedQueryResolver) Changelog

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

func (*GeneratedQueryResolver) ChangelogChange

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

func (*GeneratedQueryResolver) ChangelogChanges

func (r *GeneratedQueryResolver) ChangelogChanges(ctx context.Context, offset *int, limit *int, q *string, sort []*ChangelogChangeSortType, filter *ChangelogChangeFilterType) (*ChangelogChangeResultType, error)

func (*GeneratedQueryResolver) Changelogs

func (r *GeneratedQueryResolver) Changelogs(ctx context.Context, offset *int, limit *int, q *string, sort []*ChangelogSortType, filter *ChangelogFilterType) (*ChangelogResultType, error)

type GeneratedResolver

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

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 MutationResolver

type MutationResolver interface {
	CreateChangelogChange(ctx context.Context, input map[string]interface{}) (*ChangelogChange, error)
	UpdateChangelogChange(ctx context.Context, id string, input map[string]interface{}) (*ChangelogChange, error)
	DeleteChangelogChange(ctx context.Context, id string) (*ChangelogChange, error)
	DeleteAllChangelogChanges(ctx context.Context) (bool, error)
	CreateChangelog(ctx context.Context, input map[string]interface{}) (*Changelog, error)
	UpdateChangelog(ctx context.Context, id string, input map[string]interface{}) (*Changelog, error)
	DeleteChangelog(ctx context.Context, id string) (*Changelog, error)
	DeleteAllChangelogs(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 QueryChangelogChangeHandlerOptions

type QueryChangelogChangeHandlerOptions struct {
	ID     *string
	Q      *string
	Filter *ChangelogChangeFilterType
}

type QueryChangelogChangesHandlerOptions

type QueryChangelogChangesHandlerOptions struct {
	Offset *int
	Limit  *int
	Q      *string
	Sort   []*ChangelogChangeSortType
	Filter *ChangelogChangeFilterType
}

type QueryChangelogHandlerOptions

type QueryChangelogHandlerOptions struct {
	ID     *string
	Q      *string
	Filter *ChangelogFilterType
}

type QueryChangelogsHandlerOptions

type QueryChangelogsHandlerOptions struct {
	Offset *int
	Limit  *int
	Q      *string
	Sort   []*ChangelogSortType
	Filter *ChangelogFilterType
}

type QueryResolver

type QueryResolver interface {
	ChangelogChange(ctx context.Context, id *string, q *string, filter *ChangelogChangeFilterType) (*ChangelogChange, error)
	ChangelogChanges(ctx context.Context, offset *int, limit *int, q *string, sort []*ChangelogChangeSortType, filter *ChangelogChangeFilterType) (*ChangelogChangeResultType, error)
	Changelog(ctx context.Context, id *string, q *string, filter *ChangelogFilterType) (*Changelog, error)
	Changelogs(ctx context.Context, offset *int, limit *int, q *string, sort []*ChangelogSortType, filter *ChangelogFilterType) (*ChangelogResultType, error)
	// contains filtered or unexported methods
}

type ResolutionHandlers

type ResolutionHandlers struct {
	CreateChangelogChange     func(ctx context.Context, r *GeneratedResolver, input map[string]interface{}) (item *ChangelogChange, err error)
	UpdateChangelogChange     func(ctx context.Context, r *GeneratedResolver, id string, input map[string]interface{}) (item *ChangelogChange, err error)
	DeleteChangelogChange     func(ctx context.Context, r *GeneratedResolver, id string) (item *ChangelogChange, err error)
	DeleteAllChangelogChanges func(ctx context.Context, r *GeneratedResolver) (bool, error)
	QueryChangelogChange      func(ctx context.Context, r *GeneratedResolver, opts QueryChangelogChangeHandlerOptions) (*ChangelogChange, error)
	QueryChangelogChanges     func(ctx context.Context, r *GeneratedResolver, opts QueryChangelogChangesHandlerOptions) (*ChangelogChangeResultType, error)

	ChangelogChangeLog func(ctx context.Context, r *GeneratedChangelogChangeResolver, obj *ChangelogChange) (res *Changelog, err error)

	CreateChangelog     func(ctx context.Context, r *GeneratedResolver, input map[string]interface{}) (item *Changelog, err error)
	UpdateChangelog     func(ctx context.Context, r *GeneratedResolver, id string, input map[string]interface{}) (item *Changelog, err error)
	DeleteChangelog     func(ctx context.Context, r *GeneratedResolver, id string) (item *Changelog, err error)
	DeleteAllChangelogs func(ctx context.Context, r *GeneratedResolver) (bool, error)
	QueryChangelog      func(ctx context.Context, r *GeneratedResolver, opts QueryChangelogHandlerOptions) (*Changelog, error)
	QueryChangelogs     func(ctx context.Context, r *GeneratedResolver, opts QueryChangelogsHandlerOptions) (*ChangelogResultType, error)

	ChangelogChanges func(ctx context.Context, r *GeneratedChangelogResolver, obj *Changelog) (res []*ChangelogChange, err error)
}

func DefaultResolutionHandlers

func DefaultResolutionHandlers() ResolutionHandlers

type ResolverRoot

type ResolverRoot interface {
	Changelog() ChangelogResolver
	ChangelogChange() ChangelogChangeResolver
	ChangelogChangeResultType() ChangelogChangeResultTypeResolver
	ChangelogResultType() ChangelogResultTypeResolver
	Mutation() MutationResolver
	Query() QueryResolver
}

Jump to

Keyboard shortcuts

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