helpers

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2024 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplySort

func ApplySort(query *gorm.DB, sortBy []string) (*gorm.DB, error)

func CheckModelIsInSync

func CheckModelIsInSync(db *gorm.DB, model interface{}) error

func GetGormFields

func GetGormFields(model interface{}, filter FieldsFilter) (map[string]*schema.Field, error)

GetGormFields returns a map of fields of a model that are readable and match the filter The key of the map is the alias of the field in the graphql schema The value is the field itself.

func GetNestedPreloads

func GetNestedPreloads(
	ctx *graphql.OperationContext,
	fields []graphql.CollectedField,
	prefix string,
) []string

func GetPreloadString

func GetPreloadString(prefix, name string) string

func GetPreloads

func GetPreloads(ctx context.Context) []string

func HasAssociation

func HasAssociation(preloads []string, association string) bool

Types

type FieldsFilter

type FieldsFilter func(f *schema.Field) bool

Jump to

Keyboard shortcuts

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