Documentation ¶
Index ¶
- Variables
- func GetInputStruct(name string, obj map[string]interface{}) (interface{}, error)
- type AddCatPayload
- type AddCompanyPayload
- type AddSmartPhonePayload
- type AddTodoPayload
- type AddUserPayload
- type BooleanFilterInput
- type Cat
- type CatFiltersInput
- type CatGroup
- type CatInput
- type CatOrder
- type CatOrderable
- type CatPatch
- type CatQueryResult
- type Company
- type CompanyFiltersInput
- type CompanyGroup
- type CompanyInput
- type CompanyOrder
- type CompanyOrderable
- type CompanyPatch
- type CompanyQueryResult
- type DeleteCatPayload
- type DeleteCompanyPayload
- type DeleteSmartPhonePayload
- type DeleteTodoPayload
- type DeleteUserPayload
- type FloatFilterBetween
- type FloatFilterInput
- type IDFilterInput
- type IntFilterBetween
- type IntFilterInput
- type Mutation
- type NoSQLControl
- type Query
- type SQLCreateExtension
- type SQLMutationParams
- type SQLQueryParams
- type SmartPhone
- type SmartPhoneFiltersInput
- type SmartPhoneGroup
- type SmartPhoneInput
- type SmartPhoneOrder
- type SmartPhoneOrderable
- type SmartPhonePatch
- type SmartPhoneQueryResult
- type SoftDeleteFilterInput
- type StringFilterInput
- type TimeFilterBetween
- type TimeFilterInput
- type Todo
- type TodoFiltersInput
- type TodoGroup
- type TodoInput
- type TodoOrder
- type TodoOrderable
- type TodoPatch
- type TodoQueryResult
- type TodoType
- type UpdateCatInput
- type UpdateCatPayload
- type UpdateCompanyInput
- type UpdateCompanyPayload
- type UpdateSmartPhoneInput
- type UpdateSmartPhonePayload
- type UpdateTodoInput
- type UpdateTodoPayload
- type UpdateUserInput
- type UpdateUserPayload
- type User
- type UserFiltersInput
- type UserGroup
- type UserInput
- type UserOrder
- type UserOrderable
- type UserPatch
- type UserQueryResult
- type UserRef2TodosInput
Constants ¶
This section is empty.
Variables ¶
var AllCatGroup = []CatGroup{ CatGroupID, CatGroupName, CatGroupBirthDay, CatGroupUserID, CatGroupAlive, }
var AllCatOrderable = []CatOrderable{ CatOrderableID, CatOrderableName, CatOrderableUserID, CatOrderableAlive, }
var AllCompanyGroup = []CompanyGroup{ CompanyGroupID, CompanyGroupName, CompanyGroupDescription, CompanyGroupMotherCompanyID, CompanyGroupCreatedAt, }
var AllCompanyOrderable = []CompanyOrderable{ CompanyOrderableID, CompanyOrderableName, CompanyOrderableDescription, CompanyOrderableMotherCompanyID, }
var AllSmartPhoneGroup = []SmartPhoneGroup{ SmartPhoneGroupID, SmartPhoneGroupBrand, SmartPhoneGroupPhonenumber, SmartPhoneGroupUserID, }
var AllSmartPhoneOrderable = []SmartPhoneOrderable{ SmartPhoneOrderableID, SmartPhoneOrderableBrand, SmartPhoneOrderablePhonenumber, SmartPhoneOrderableUserID, }
var AllTodoGroup = []TodoGroup{ TodoGroupID, TodoGroupName, TodoGroupOwnerID, TodoGroupCreatedAt, TodoGroupUpdatedAt, TodoGroupDeletedAt, }
var AllTodoOrderable = []TodoOrderable{ TodoOrderableID, TodoOrderableName, TodoOrderableOwnerID, }
var AllTodoType = []TodoType{ TodoTypeBug, TodoTypeFeature, }
var AllUserGroup = []UserGroup{ UserGroupID, UserGroupName, UserGroupCreatedAt, UserGroupUpdatedAt, UserGroupCompanyID, UserGroupMoney, UserGroupFavoritColor, UserGroupEmail, UserGroupOtherDate, }
var AllUserOrderable = []UserOrderable{ UserOrderableID, UserOrderableName, UserOrderableCompanyID, UserOrderableMoney, UserOrderableFavoritColor, UserOrderableEmail, }
Functions ¶
func GetInputStruct ¶ added in v0.2.0
GetInputStruct returns struct filled from map obj defined by name Example useage struct validation with github.com/go-playground/validator by directive:
func ValidateDirective(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error) { field := graphql.GetPathContext(ctx) if data, ok := obj.(map[string]interface{}); ok { for _, v := range field.ParentField.Field.Arguments { name := v.Value.ExpectedType.Name() model, err := model.GetInputStruct(name, data) if err != nil { //handle not found error } if err := validate.Struct(model); err != nil { //handle error } } } return next(ctx) }
Types ¶
type AddCatPayload ¶
type AddCatPayload struct { Cat *CatQueryResult `json:"cat"` Affected []*Cat `json:"affected"` }
AddCat result with filterable data and affected rows
type AddCompanyPayload ¶
type AddCompanyPayload struct { Company *CompanyQueryResult `json:"company"` Affected []*Company `json:"affected"` }
AddCompany result with filterable data and affected rows
type AddSmartPhonePayload ¶ added in v0.1.5
type AddSmartPhonePayload struct { SmartPhone *SmartPhoneQueryResult `json:"smartPhone"` Affected []*SmartPhone `json:"affected"` }
AddSmartPhone result with filterable data and affected rows
type AddTodoPayload ¶
type AddTodoPayload struct { Todo *TodoQueryResult `json:"todo"` Affected []*Todo `json:"affected"` }
AddTodo result with filterable data and affected rows
type AddUserPayload ¶
type AddUserPayload struct { User *UserQueryResult `json:"user"` Affected []*User `json:"affected"` }
AddUser result with filterable data and affected rows
type BooleanFilterInput ¶
type BooleanFilterInput struct { And []*bool `json:"and,omitempty"` Or []*bool `json:"or,omitempty"` Not *BooleanFilterInput `json:"not,omitempty"` Is *bool `json:"is,omitempty"` Null *bool `json:"null,omitempty"` NotNull *bool `json:"notNull,omitempty"` }
Boolean Filter simple datatypes
func (*BooleanFilterInput) ExtendsDatabaseQuery ¶
func (d *BooleanFilterInput) ExtendsDatabaseQuery(db *gorm.DB, fieldName string, deep bool, blackList map[string]struct{}) []runtimehelper.ConditionElement
ExtendsDatabaseQuery create condition from values
type CatFiltersInput ¶
type CatFiltersInput struct { ID *IDFilterInput `json:"id,omitempty"` Name *StringFilterInput `json:"name,omitempty"` BirthDay *TimeFilterInput `json:"birthDay,omitempty"` UserID *IntFilterInput `json:"userID,omitempty"` Alive *BooleanFilterInput `json:"alive,omitempty"` And []*CatFiltersInput `json:"and,omitempty"` Or []*CatFiltersInput `json:"or,omitempty"` Not *CatFiltersInput `json:"not,omitempty"` }
Filter input selection for Cat Can be used f.e.: by queryCat
func (*CatFiltersInput) ExtendsDatabaseQuery ¶
func (d *CatFiltersInput) ExtendsDatabaseQuery(db *gorm.DB, alias string, deep bool, blackList map[string]struct{}) []runtimehelper.ConditionElement
ExtendsDatabaseQuery create condition from CatFiltersInput values
func (*CatFiltersInput) PrimaryKeyName ¶
func (d *CatFiltersInput) PrimaryKeyName() string
PrimaryKeyName return the name of primarykey for Table Cat
type CatGroup ¶ added in v0.4.0
type CatGroup string
Groupable data for Cat Can be used f.e.: by queryCat
func (CatGroup) MarshalGQL ¶ added in v0.4.0
func (*CatGroup) UnmarshalGQL ¶ added in v0.4.0
type CatInput ¶
type CatInput struct { Name string `json:"name"` BirthDay time.Time `json:"birthDay"` UserID int `json:"userID"` Alive *bool `json:"alive,omitempty"` }
Cat Input value to add new Cat
func CatInputFromMap ¶ added in v0.2.0
CatInputFromMap return a CatInput from data map use github.com/mitchellh/mapstructure with reflaction
func (*CatInput) MergeToType ¶
MergeToType retuns a Cat filled from CatInput
type CatOrder ¶
type CatOrder struct { Asc *CatOrderable `json:"asc,omitempty"` Desc *CatOrderable `json:"desc,omitempty"` }
Order Cat by asc or desc
type CatOrderable ¶
type CatOrderable string
for Cat a enum of all orderable entities can be used f.e.: queryCat
const ( CatOrderableID CatOrderable = "id" CatOrderableName CatOrderable = "name" CatOrderableUserID CatOrderable = "userID" CatOrderableAlive CatOrderable = "alive" )
func (CatOrderable) IsValid ¶
func (e CatOrderable) IsValid() bool
func (CatOrderable) MarshalGQL ¶
func (e CatOrderable) MarshalGQL(w io.Writer)
func (CatOrderable) String ¶
func (e CatOrderable) String() string
func (*CatOrderable) UnmarshalGQL ¶
func (e *CatOrderable) UnmarshalGQL(v interface{}) error
type CatPatch ¶
type CatPatch struct { Name *string `json:"name,omitempty"` BirthDay *time.Time `json:"birthDay,omitempty"` UserID *int `json:"userID,omitempty"` Alive *bool `json:"alive,omitempty"` }
Cat Patch value all values are optional to update Cat entities
func (*CatPatch) MergeToType ¶
MergeToType returns a map with all values set to CatPatch
type CatQueryResult ¶
type CatQueryResult struct { Data []*Cat `json:"data"` Count int `json:"count"` TotalCount int `json:"totalCount"` }
Cat result
type Company ¶
type Company struct { ID int `json:"id" gorm:"primaryKey;autoIncrement;"` Name string `json:"name"` Description *string `json:"description,omitempty"` MotherCompanyID *int `json:"motherCompanyID,omitempty"` MotherCompany *Company `json:"motherCompany,omitempty"` CreatedAt *time.Time `json:"createdAt,omitempty"` }
type CompanyFiltersInput ¶
type CompanyFiltersInput struct { ID *IDFilterInput `json:"id,omitempty"` Name *StringFilterInput `json:"name,omitempty"` Description *StringFilterInput `json:"description,omitempty"` MotherCompanyID *IntFilterInput `json:"motherCompanyID,omitempty"` MotherCompany *CompanyFiltersInput `json:"motherCompany,omitempty"` CreatedAt *TimeFilterInput `json:"createdAt,omitempty"` And []*CompanyFiltersInput `json:"and,omitempty"` Or []*CompanyFiltersInput `json:"or,omitempty"` Not *CompanyFiltersInput `json:"not,omitempty"` }
Filter input selection for Company Can be used f.e.: by queryCompany
func (*CompanyFiltersInput) ExtendsDatabaseQuery ¶
func (d *CompanyFiltersInput) ExtendsDatabaseQuery(db *gorm.DB, alias string, deep bool, blackList map[string]struct{}) []runtimehelper.ConditionElement
ExtendsDatabaseQuery create condition from CompanyFiltersInput values
func (*CompanyFiltersInput) PrimaryKeyName ¶
func (d *CompanyFiltersInput) PrimaryKeyName() string
PrimaryKeyName return the name of primarykey for Table Company
type CompanyGroup ¶ added in v0.4.0
type CompanyGroup string
Groupable data for Company Can be used f.e.: by queryCompany
const ( CompanyGroupID CompanyGroup = "id" CompanyGroupName CompanyGroup = "name" CompanyGroupDescription CompanyGroup = "description" CompanyGroupMotherCompanyID CompanyGroup = "motherCompanyID" CompanyGroupCreatedAt CompanyGroup = "createdAt" )
func (CompanyGroup) IsValid ¶ added in v0.4.0
func (e CompanyGroup) IsValid() bool
func (CompanyGroup) MarshalGQL ¶ added in v0.4.0
func (e CompanyGroup) MarshalGQL(w io.Writer)
func (CompanyGroup) String ¶ added in v0.4.0
func (e CompanyGroup) String() string
func (*CompanyGroup) UnmarshalGQL ¶ added in v0.4.0
func (e *CompanyGroup) UnmarshalGQL(v interface{}) error
type CompanyInput ¶
type CompanyInput struct { Name string `json:"name"` Description *string `json:"description,omitempty"` MotherCompanyID *int `json:"motherCompanyID,omitempty"` MotherCompany *CompanyInput `json:"motherCompany,omitempty"` }
Company Input value to add new Company
func CompanyInputFromMap ¶ added in v0.2.0
func CompanyInputFromMap(data map[string]interface{}) (CompanyInput, error)
CompanyInputFromMap return a CompanyInput from data map use github.com/mitchellh/mapstructure with reflaction
func (*CompanyInput) MergeToType ¶
func (d *CompanyInput) MergeToType() Company
MergeToType retuns a Company filled from CompanyInput
type CompanyOrder ¶
type CompanyOrder struct { Asc *CompanyOrderable `json:"asc,omitempty"` Desc *CompanyOrderable `json:"desc,omitempty"` }
Order Company by asc or desc
type CompanyOrderable ¶
type CompanyOrderable string
for Company a enum of all orderable entities can be used f.e.: queryCompany
const ( CompanyOrderableID CompanyOrderable = "id" CompanyOrderableName CompanyOrderable = "name" CompanyOrderableDescription CompanyOrderable = "description" CompanyOrderableMotherCompanyID CompanyOrderable = "motherCompanyID" )
func (CompanyOrderable) IsValid ¶
func (e CompanyOrderable) IsValid() bool
func (CompanyOrderable) MarshalGQL ¶
func (e CompanyOrderable) MarshalGQL(w io.Writer)
func (CompanyOrderable) String ¶
func (e CompanyOrderable) String() string
func (*CompanyOrderable) UnmarshalGQL ¶
func (e *CompanyOrderable) UnmarshalGQL(v interface{}) error
type CompanyPatch ¶
type CompanyPatch struct { Name *string `json:"name,omitempty"` Description *string `json:"description,omitempty"` MotherCompanyID *int `json:"motherCompanyID,omitempty"` MotherCompany *CompanyPatch `json:"motherCompany,omitempty"` }
Company Patch value all values are optional to update Company entities
func (*CompanyPatch) MergeToType ¶
func (d *CompanyPatch) MergeToType() map[string]interface{}
MergeToType returns a map with all values set to CompanyPatch
type CompanyQueryResult ¶
type CompanyQueryResult struct { Data []*Company `json:"data"` Count int `json:"count"` TotalCount int `json:"totalCount"` }
Company result
type DeleteCatPayload ¶
type DeleteCatPayload struct { Cat *CatQueryResult `json:"cat"` // Count of deleted Cat entities Count int `json:"count"` Msg *string `json:"msg,omitempty"` }
DeleteCat result with filterable data and count of affected entries
type DeleteCompanyPayload ¶
type DeleteCompanyPayload struct { Company *CompanyQueryResult `json:"company"` // Count of deleted Company entities Count int `json:"count"` Msg *string `json:"msg,omitempty"` }
DeleteCompany result with filterable data and count of affected entries
type DeleteSmartPhonePayload ¶ added in v0.1.5
type DeleteSmartPhonePayload struct { SmartPhone *SmartPhoneQueryResult `json:"smartPhone"` // Count of deleted SmartPhone entities Count int `json:"count"` Msg *string `json:"msg,omitempty"` }
DeleteSmartPhone result with filterable data and count of affected entries
type DeleteTodoPayload ¶
type DeleteTodoPayload struct { Todo *TodoQueryResult `json:"todo"` // Count of deleted Todo entities Count int `json:"count"` Msg *string `json:"msg,omitempty"` }
DeleteTodo result with filterable data and count of affected entries
type DeleteUserPayload ¶
type DeleteUserPayload struct { User *UserQueryResult `json:"user"` // Count of deleted User entities Count int `json:"count"` Msg *string `json:"msg,omitempty"` }
DeleteUser result with filterable data and count of affected entries
type FloatFilterBetween ¶ added in v0.5.0
Filter between start and end (start > value < end)
type FloatFilterInput ¶ added in v0.5.0
type FloatFilterInput struct { And []*float64 `json:"and,omitempty"` Or []*float64 `json:"or,omitempty"` Not *FloatFilterInput `json:"not,omitempty"` Eq *float64 `json:"eq,omitempty"` Ne *float64 `json:"ne,omitempty"` Gt *float64 `json:"gt,omitempty"` Gte *float64 `json:"gte,omitempty"` Lt *float64 `json:"lt,omitempty"` Lte *float64 `json:"lte,omitempty"` Null *bool `json:"null,omitempty"` NotNull *bool `json:"notNull,omitempty"` In []*float64 `json:"in,omitempty"` NotIn []*float64 `json:"notIn,omitempty"` Between *FloatFilterBetween `json:"between,omitempty"` }
Float Filter simple datatypes
func (*FloatFilterInput) ExtendsDatabaseQuery ¶ added in v0.5.0
func (d *FloatFilterInput) ExtendsDatabaseQuery(db *gorm.DB, fieldName string, deep bool, blackList map[string]struct{}) []runtimehelper.ConditionElement
ExtendsDatabaseQuery create condition from values
type IDFilterInput ¶
type IDFilterInput struct { And []*int `json:"and,omitempty"` Or []*int `json:"or,omitempty"` Not *IDFilterInput `json:"not,omitempty"` Eq *int `json:"eq,omitempty"` Ne *int `json:"ne,omitempty"` Null *bool `json:"null,omitempty"` NotNull *bool `json:"notNull,omitempty"` In []*int `json:"in,omitempty"` Notin []*int `json:"notin,omitempty"` }
ID Filter simple datatypes
func (*IDFilterInput) ExtendsDatabaseQuery ¶
func (d *IDFilterInput) ExtendsDatabaseQuery(db *gorm.DB, fieldName string, deep bool, blackList map[string]struct{}) []runtimehelper.ConditionElement
ExtendsDatabaseQuery create condition from values
type IntFilterBetween ¶
Filter between start and end (start > value < end)
type IntFilterInput ¶
type IntFilterInput struct { And []*int `json:"and,omitempty"` Or []*int `json:"or,omitempty"` Not *IntFilterInput `json:"not,omitempty"` Eq *int `json:"eq,omitempty"` Ne *int `json:"ne,omitempty"` Gt *int `json:"gt,omitempty"` Gte *int `json:"gte,omitempty"` Lt *int `json:"lt,omitempty"` Lte *int `json:"lte,omitempty"` Null *bool `json:"null,omitempty"` NotNull *bool `json:"notNull,omitempty"` In []*int `json:"in,omitempty"` NotIn []*int `json:"notIn,omitempty"` Between *IntFilterBetween `json:"between,omitempty"` }
Int Filter simple datatypes
func (*IntFilterInput) ExtendsDatabaseQuery ¶
func (d *IntFilterInput) ExtendsDatabaseQuery(db *gorm.DB, fieldName string, deep bool, blackList map[string]struct{}) []runtimehelper.ConditionElement
ExtendsDatabaseQuery create condition from values
type NoSQLControl ¶ added in v0.4.1
type SQLCreateExtension ¶
type SQLMutationParams ¶
type SQLMutationParams struct { Add *SQLCreateExtension `json:"add,omitempty"` Update *SQLCreateExtension `json:"update,omitempty"` Delete *SQLCreateExtension `json:"delete,omitempty"` DirectiveExt []string `json:"directiveExt,omitempty"` }
type SQLQueryParams ¶
type SQLQueryParams struct { Get *SQLCreateExtension `json:"get,omitempty"` Query *SQLCreateExtension `json:"query,omitempty"` DirectiveExt []string `json:"directiveExt,omitempty"` }
type SmartPhone ¶ added in v0.1.5
type SmartPhoneFiltersInput ¶ added in v0.1.5
type SmartPhoneFiltersInput struct { ID *IDFilterInput `json:"id,omitempty"` Brand *StringFilterInput `json:"brand,omitempty"` Phonenumber *StringFilterInput `json:"phonenumber,omitempty"` UserID *IDFilterInput `json:"userID,omitempty"` And []*SmartPhoneFiltersInput `json:"and,omitempty"` Or []*SmartPhoneFiltersInput `json:"or,omitempty"` Not *SmartPhoneFiltersInput `json:"not,omitempty"` }
Filter input selection for SmartPhone Can be used f.e.: by querySmartPhone
func (*SmartPhoneFiltersInput) ExtendsDatabaseQuery ¶ added in v0.1.5
func (d *SmartPhoneFiltersInput) ExtendsDatabaseQuery(db *gorm.DB, alias string, deep bool, blackList map[string]struct{}) []runtimehelper.ConditionElement
ExtendsDatabaseQuery create condition from SmartPhoneFiltersInput values
func (*SmartPhoneFiltersInput) PrimaryKeyName ¶ added in v0.1.5
func (d *SmartPhoneFiltersInput) PrimaryKeyName() string
PrimaryKeyName return the name of primarykey for Table SmartPhone
type SmartPhoneGroup ¶ added in v0.4.0
type SmartPhoneGroup string
Groupable data for SmartPhone Can be used f.e.: by querySmartPhone
const ( SmartPhoneGroupID SmartPhoneGroup = "id" SmartPhoneGroupBrand SmartPhoneGroup = "brand" SmartPhoneGroupPhonenumber SmartPhoneGroup = "phonenumber" SmartPhoneGroupUserID SmartPhoneGroup = "userID" )
func (SmartPhoneGroup) IsValid ¶ added in v0.4.0
func (e SmartPhoneGroup) IsValid() bool
func (SmartPhoneGroup) MarshalGQL ¶ added in v0.4.0
func (e SmartPhoneGroup) MarshalGQL(w io.Writer)
func (SmartPhoneGroup) String ¶ added in v0.4.0
func (e SmartPhoneGroup) String() string
func (*SmartPhoneGroup) UnmarshalGQL ¶ added in v0.4.0
func (e *SmartPhoneGroup) UnmarshalGQL(v interface{}) error
type SmartPhoneInput ¶ added in v0.1.5
type SmartPhoneInput struct { Brand string `json:"brand"` Phonenumber string `json:"phonenumber"` UserID int `json:"userID"` }
SmartPhone Input value to add new SmartPhone
func SmartPhoneInputFromMap ¶ added in v0.2.0
func SmartPhoneInputFromMap(data map[string]interface{}) (SmartPhoneInput, error)
SmartPhoneInputFromMap return a SmartPhoneInput from data map use github.com/mitchellh/mapstructure with reflaction
func (*SmartPhoneInput) MergeToType ¶ added in v0.1.5
func (d *SmartPhoneInput) MergeToType() SmartPhone
MergeToType retuns a SmartPhone filled from SmartPhoneInput
type SmartPhoneOrder ¶ added in v0.1.5
type SmartPhoneOrder struct { Asc *SmartPhoneOrderable `json:"asc,omitempty"` Desc *SmartPhoneOrderable `json:"desc,omitempty"` }
Order SmartPhone by asc or desc
type SmartPhoneOrderable ¶ added in v0.1.5
type SmartPhoneOrderable string
for SmartPhone a enum of all orderable entities can be used f.e.: querySmartPhone
const ( SmartPhoneOrderableID SmartPhoneOrderable = "id" SmartPhoneOrderableBrand SmartPhoneOrderable = "brand" SmartPhoneOrderablePhonenumber SmartPhoneOrderable = "phonenumber" SmartPhoneOrderableUserID SmartPhoneOrderable = "userID" )
func (SmartPhoneOrderable) IsValid ¶ added in v0.1.5
func (e SmartPhoneOrderable) IsValid() bool
func (SmartPhoneOrderable) MarshalGQL ¶ added in v0.1.5
func (e SmartPhoneOrderable) MarshalGQL(w io.Writer)
func (SmartPhoneOrderable) String ¶ added in v0.1.5
func (e SmartPhoneOrderable) String() string
func (*SmartPhoneOrderable) UnmarshalGQL ¶ added in v0.1.5
func (e *SmartPhoneOrderable) UnmarshalGQL(v interface{}) error
type SmartPhonePatch ¶ added in v0.1.5
type SmartPhonePatch struct { Brand *string `json:"brand,omitempty"` Phonenumber *string `json:"phonenumber,omitempty"` UserID *int `json:"userID,omitempty"` }
SmartPhone Patch value all values are optional to update SmartPhone entities
func (*SmartPhonePatch) MergeToType ¶ added in v0.1.5
func (d *SmartPhonePatch) MergeToType() map[string]interface{}
MergeToType returns a map with all values set to SmartPhonePatch
type SmartPhoneQueryResult ¶ added in v0.1.5
type SmartPhoneQueryResult struct { Data []*SmartPhone `json:"data"` Count int `json:"count"` TotalCount int `json:"totalCount"` }
SmartPhone result
type SoftDeleteFilterInput ¶ added in v0.5.4
type SoftDeleteFilterInput struct { And []*time.Time `json:"and,omitempty"` Or []*time.Time `json:"or,omitempty"` Not *SoftDeleteFilterInput `json:"not,omitempty"` Eq *time.Time `json:"eq,omitempty"` Ne *time.Time `json:"ne,omitempty"` Gt *time.Time `json:"gt,omitempty"` Gte *time.Time `json:"gte,omitempty"` Lt *time.Time `json:"lt,omitempty"` Lte *time.Time `json:"lte,omitempty"` Null *bool `json:"null,omitempty"` NotNull *bool `json:"notNull,omitempty"` In []*time.Time `json:"in,omitempty"` NotIn []*time.Time `json:"notIn,omitempty"` Between *TimeFilterBetween `json:"between,omitempty"` }
SoftDelete Filter simple datatypes
func (*SoftDeleteFilterInput) ExtendsDatabaseQuery ¶ added in v0.5.4
func (d *SoftDeleteFilterInput) ExtendsDatabaseQuery(db *gorm.DB, fieldName string, deep bool, blackList map[string]struct{}) []runtimehelper.ConditionElement
ExtendsDatabaseQuery create condition from values
type StringFilterInput ¶
type StringFilterInput struct { And []*string `json:"and,omitempty"` Or []*string `json:"or,omitempty"` Not *StringFilterInput `json:"not,omitempty"` Eq *string `json:"eq,omitempty"` Eqi *string `json:"eqi,omitempty"` Ne *string `json:"ne,omitempty"` StartsWith *string `json:"startsWith,omitempty"` EndsWith *string `json:"endsWith,omitempty"` Contains *string `json:"contains,omitempty"` NotContains *string `json:"notContains,omitempty"` Containsi *string `json:"containsi,omitempty"` NotContainsi *string `json:"notContainsi,omitempty"` Null *bool `json:"null,omitempty"` NotNull *bool `json:"notNull,omitempty"` In []*string `json:"in,omitempty"` NotIn []*string `json:"notIn,omitempty"` }
String Filter simple datatypes
func (*StringFilterInput) ExtendsDatabaseQuery ¶
func (d *StringFilterInput) ExtendsDatabaseQuery(db *gorm.DB, fieldName string, deep bool, blackList map[string]struct{}) []runtimehelper.ConditionElement
type TimeFilterBetween ¶
Filter between start and end (start > value < end)
type TimeFilterInput ¶
type TimeFilterInput struct { And []*time.Time `json:"and,omitempty"` Or []*time.Time `json:"or,omitempty"` Not *TimeFilterInput `json:"not,omitempty"` Eq *time.Time `json:"eq,omitempty"` Ne *time.Time `json:"ne,omitempty"` Gt *time.Time `json:"gt,omitempty"` Gte *time.Time `json:"gte,omitempty"` Lt *time.Time `json:"lt,omitempty"` Lte *time.Time `json:"lte,omitempty"` Null *bool `json:"null,omitempty"` NotNull *bool `json:"notNull,omitempty"` In []*time.Time `json:"in,omitempty"` NotIn []*time.Time `json:"notIn,omitempty"` Between *TimeFilterBetween `json:"between,omitempty"` }
Time Filter simple datatypes
func (*TimeFilterInput) ExtendsDatabaseQuery ¶
func (d *TimeFilterInput) ExtendsDatabaseQuery(db *gorm.DB, fieldName string, deep bool, blackList map[string]struct{}) []runtimehelper.ConditionElement
ExtendsDatabaseQuery create condition from values
type Todo ¶
type Todo struct { ID int `json:"id" gorm:"primaryKey;autoIncrement;"` Name string `json:"name"` Users []*User `json:"users" gorm:"many2many:todo_users;constraint:OnDelete:CASCADE;"` Owner *User `json:"owner"` OwnerID int `json:"ownerID"` CreatedAt *time.Time `json:"createdAt,omitempty"` UpdatedAt *time.Time `json:"updatedAt,omitempty"` DeletedAt *time.Time `json:"deletedAt,omitempty"` Etype1 *TodoType `json:"etype1,omitempty"` Etype5 TodoType `json:"etype5"` Test123 *string `json:"test123,omitempty"` }
type TodoFiltersInput ¶
type TodoFiltersInput struct { ID *IDFilterInput `json:"id,omitempty"` Name *StringFilterInput `json:"name,omitempty"` Users *UserFiltersInput `json:"users,omitempty"` Owner *UserFiltersInput `json:"owner,omitempty"` OwnerID *IDFilterInput `json:"ownerID,omitempty"` CreatedAt *TimeFilterInput `json:"createdAt,omitempty"` UpdatedAt *TimeFilterInput `json:"updatedAt,omitempty"` DeletedAt *TimeFilterInput `json:"deletedAt,omitempty"` Etype1 *StringFilterInput `json:"etype1,omitempty"` Etype5 *StringFilterInput `json:"etype5,omitempty"` And []*TodoFiltersInput `json:"and,omitempty"` Or []*TodoFiltersInput `json:"or,omitempty"` Not *TodoFiltersInput `json:"not,omitempty"` }
Filter input selection for Todo Can be used f.e.: by queryTodo
func (*TodoFiltersInput) ExtendsDatabaseQuery ¶
func (d *TodoFiltersInput) ExtendsDatabaseQuery(db *gorm.DB, alias string, deep bool, blackList map[string]struct{}) []runtimehelper.ConditionElement
ExtendsDatabaseQuery create condition from TodoFiltersInput values
func (*TodoFiltersInput) PrimaryKeyName ¶
func (d *TodoFiltersInput) PrimaryKeyName() string
PrimaryKeyName return the name of primarykey for Table Todo
type TodoGroup ¶ added in v0.4.0
type TodoGroup string
Groupable data for Todo Can be used f.e.: by queryTodo
func (TodoGroup) MarshalGQL ¶ added in v0.4.0
func (*TodoGroup) UnmarshalGQL ¶ added in v0.4.0
type TodoInput ¶
type TodoInput struct { Name string `json:"name"` Etype1 *TodoType `json:"etype1,omitempty"` Etype5 TodoType `json:"etype5"` Test123 *string `json:"test123,omitempty"` }
Todo Input value to add new Todo
func TodoInputFromMap ¶ added in v0.2.0
TodoInputFromMap return a TodoInput from data map use github.com/mitchellh/mapstructure with reflaction
func (*TodoInput) MergeToType ¶
MergeToType retuns a Todo filled from TodoInput
type TodoOrder ¶
type TodoOrder struct { Asc *TodoOrderable `json:"asc,omitempty"` Desc *TodoOrderable `json:"desc,omitempty"` }
Order Todo by asc or desc
type TodoOrderable ¶
type TodoOrderable string
for Todo a enum of all orderable entities can be used f.e.: queryTodo
const ( TodoOrderableID TodoOrderable = "id" TodoOrderableName TodoOrderable = "name" TodoOrderableOwnerID TodoOrderable = "ownerID" )
func (TodoOrderable) IsValid ¶
func (e TodoOrderable) IsValid() bool
func (TodoOrderable) MarshalGQL ¶
func (e TodoOrderable) MarshalGQL(w io.Writer)
func (TodoOrderable) String ¶
func (e TodoOrderable) String() string
func (*TodoOrderable) UnmarshalGQL ¶
func (e *TodoOrderable) UnmarshalGQL(v interface{}) error
type TodoPatch ¶
type TodoPatch struct { Name *string `json:"name,omitempty"` Etype1 *TodoType `json:"etype1,omitempty"` Etype5 *TodoType `json:"etype5,omitempty"` Test123 *string `json:"test123,omitempty"` }
Todo Patch value all values are optional to update Todo entities
func (*TodoPatch) MergeToType ¶
MergeToType returns a map with all values set to TodoPatch
type TodoQueryResult ¶
type TodoQueryResult struct { Data []*Todo `json:"data"` Count int `json:"count"` TotalCount int `json:"totalCount"` }
Todo result
type TodoType ¶ added in v0.1.4
type TodoType string
func (TodoType) MarshalGQL ¶ added in v0.1.4
func (*TodoType) MergeToType ¶ added in v0.1.4
MergeToType for enum value TodoType
func (*TodoType) UnmarshalGQL ¶ added in v0.1.4
type UpdateCatInput ¶
type UpdateCatInput struct { Filter *CatFiltersInput `json:"filter"` Set *CatPatch `json:"set"` }
Update rules for Cat multiupdates simple possible by global filtervalue
type UpdateCatPayload ¶
type UpdateCatPayload struct { Cat *CatQueryResult `json:"cat"` // Count of affected updates Count int `json:"count"` Affected []*Cat `json:"affected"` }
UpdateCat result with filterable data and affected rows
type UpdateCompanyInput ¶
type UpdateCompanyInput struct { Filter *CompanyFiltersInput `json:"filter"` Set *CompanyPatch `json:"set"` }
Update rules for Company multiupdates simple possible by global filtervalue
type UpdateCompanyPayload ¶
type UpdateCompanyPayload struct { Company *CompanyQueryResult `json:"company"` // Count of affected updates Count int `json:"count"` Affected []*Company `json:"affected"` }
UpdateCompany result with filterable data and affected rows
type UpdateSmartPhoneInput ¶ added in v0.1.5
type UpdateSmartPhoneInput struct { Filter *SmartPhoneFiltersInput `json:"filter"` Set *SmartPhonePatch `json:"set"` }
Update rules for SmartPhone multiupdates simple possible by global filtervalue
type UpdateSmartPhonePayload ¶ added in v0.1.5
type UpdateSmartPhonePayload struct { SmartPhone *SmartPhoneQueryResult `json:"smartPhone"` // Count of affected updates Count int `json:"count"` Affected []*SmartPhone `json:"affected"` }
UpdateSmartPhone result with filterable data and affected rows
type UpdateTodoInput ¶
type UpdateTodoInput struct { Filter *TodoFiltersInput `json:"filter"` Set *TodoPatch `json:"set"` }
Update rules for Todo multiupdates simple possible by global filtervalue
type UpdateTodoPayload ¶
type UpdateTodoPayload struct { Todo *TodoQueryResult `json:"todo"` // Count of affected updates Count int `json:"count"` Affected []*Todo `json:"affected"` }
UpdateTodo result with filterable data and affected rows
type UpdateUserInput ¶
type UpdateUserInput struct { Filter *UserFiltersInput `json:"filter"` Set *UserPatch `json:"set"` }
Update rules for User multiupdates simple possible by global filtervalue
type UpdateUserPayload ¶
type UpdateUserPayload struct { User *UserQueryResult `json:"user"` // Count of affected updates Count int `json:"count"` Affected []*User `json:"affected"` }
UpdateUser result with filterable data and affected rows
type User ¶
type User struct { ID int `json:"id" gorm:"primaryKey;autoIncrement;"` Name string `json:"name"` CreatedAt *time.Time `json:"createdAt,omitempty"` UpdatedAt *time.Time `json:"updatedAt,omitempty"` DeletedAt *runtimehelper.SoftDelete `json:"deletedAt,omitempty" gorm:"index;"` Cat *Cat `json:"cat,omitempty" gorm:"constraint:OnUpdate:CASCADE,OnDelete:SET NULL;;"` CompanyID *int `json:"companyID,omitempty"` Money *float64 `json:"money,omitempty"` Company *Company `json:"company,omitempty"` SmartPhones []*SmartPhone `json:"smartPhones,omitempty"` FavoritColor *string `json:"favoritColor,omitempty"` Email string `json:"email"` OtherDate *time.Time `json:"otherDate,omitempty"` }
type UserFiltersInput ¶
type UserFiltersInput struct { ID *IDFilterInput `json:"id,omitempty"` Name *StringFilterInput `json:"name,omitempty"` CreatedAt *TimeFilterInput `json:"createdAt,omitempty"` UpdatedAt *TimeFilterInput `json:"updatedAt,omitempty"` Cat *CatFiltersInput `json:"cat,omitempty"` CompanyID *IntFilterInput `json:"companyID,omitempty"` Money *FloatFilterInput `json:"money,omitempty"` Company *CompanyFiltersInput `json:"company,omitempty"` SmartPhones *SmartPhoneFiltersInput `json:"smartPhones,omitempty"` FavoritColor *StringFilterInput `json:"favoritColor,omitempty"` Email *StringFilterInput `json:"email,omitempty"` OtherDate *TimeFilterInput `json:"otherDate,omitempty"` And []*UserFiltersInput `json:"and,omitempty"` Or []*UserFiltersInput `json:"or,omitempty"` Not *UserFiltersInput `json:"not,omitempty"` }
Filter input selection for User Can be used f.e.: by queryUser
func (*UserFiltersInput) ExtendsDatabaseQuery ¶
func (d *UserFiltersInput) ExtendsDatabaseQuery(db *gorm.DB, alias string, deep bool, blackList map[string]struct{}) []runtimehelper.ConditionElement
ExtendsDatabaseQuery create condition from UserFiltersInput values
func (*UserFiltersInput) PrimaryKeyName ¶
func (d *UserFiltersInput) PrimaryKeyName() string
PrimaryKeyName return the name of primarykey for Table User
type UserGroup ¶ added in v0.4.0
type UserGroup string
Groupable data for User Can be used f.e.: by queryUser
const ( UserGroupID UserGroup = "id" UserGroupName UserGroup = "name" UserGroupCreatedAt UserGroup = "createdAt" UserGroupUpdatedAt UserGroup = "updatedAt" UserGroupCompanyID UserGroup = "companyID" UserGroupMoney UserGroup = "money" UserGroupFavoritColor UserGroup = "favoritColor" UserGroupEmail UserGroup = "email" UserGroupOtherDate UserGroup = "otherDate" )
func (UserGroup) MarshalGQL ¶ added in v0.4.0
func (*UserGroup) UnmarshalGQL ¶ added in v0.4.0
type UserInput ¶
type UserInput struct { Name string `json:"name"` Cat *CatInput `json:"cat,omitempty"` CompanyID *int `json:"companyID,omitempty"` Money *float64 `json:"money,omitempty"` Company *CompanyInput `json:"company,omitempty"` SmartPhones []*SmartPhoneInput `json:"smartPhones,omitempty"` FavoritColor *string `json:"favoritColor,omitempty" validate:"omitempty,hexcolor|rgb|rgba"` Email string `json:"email" validate:"required,email"` OtherDate *time.Time `json:"otherDate,omitempty"` }
User Input value to add new User
func UserInputFromMap ¶ added in v0.2.0
UserInputFromMap return a UserInput from data map use github.com/mitchellh/mapstructure with reflaction
func (*UserInput) MergeToType ¶
MergeToType retuns a User filled from UserInput
type UserOrder ¶
type UserOrder struct { Asc *UserOrderable `json:"asc,omitempty"` Desc *UserOrderable `json:"desc,omitempty"` }
Order User by asc or desc
type UserOrderable ¶
type UserOrderable string
for User a enum of all orderable entities can be used f.e.: queryUser
const ( UserOrderableID UserOrderable = "id" UserOrderableName UserOrderable = "name" UserOrderableCompanyID UserOrderable = "companyID" UserOrderableMoney UserOrderable = "money" UserOrderableFavoritColor UserOrderable = "favoritColor" UserOrderableEmail UserOrderable = "email" )
func (UserOrderable) IsValid ¶
func (e UserOrderable) IsValid() bool
func (UserOrderable) MarshalGQL ¶
func (e UserOrderable) MarshalGQL(w io.Writer)
func (UserOrderable) String ¶
func (e UserOrderable) String() string
func (*UserOrderable) UnmarshalGQL ¶
func (e *UserOrderable) UnmarshalGQL(v interface{}) error
type UserPatch ¶
type UserPatch struct { Name *string `json:"name,omitempty"` Cat *CatPatch `json:"cat,omitempty"` CompanyID *int `json:"companyID,omitempty"` Money *float64 `json:"money,omitempty"` Company *CompanyPatch `json:"company,omitempty"` SmartPhones []*SmartPhonePatch `json:"smartPhones,omitempty"` FavoritColor *string `json:"favoritColor,omitempty" validate:"omitempty,hexcolor|rgb|rgba"` Email *string `json:"email,omitempty" validate:"required,email"` OtherDate *time.Time `json:"otherDate,omitempty"` }
User Patch value all values are optional to update User entities
func (*UserPatch) MergeToType ¶
MergeToType returns a map with all values set to UserPatch
type UserQueryResult ¶
type UserQueryResult struct { Data []*User `json:"data"` Count int `json:"count"` TotalCount int `json:"totalCount"` }
User result
type UserRef2TodosInput ¶
type UserRef2TodosInput struct { Filter *TodoFiltersInput `json:"filter"` Set []int `json:"set"` }
Many 2 many input between Todo and User Filter to Select Todo and set to set list of User PrimaryKeys