enum

package
v0.1.18 Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const JS_MIN_SAFE_INT = -9007199254740991

min int. weird to have enum with unknown value

Variables

This section is empty.

Functions

func CompareEnums added in v0.0.38

func CompareEnums(l1, l2 []*Enum) ([]change.Change, error)

this is different from compareEnums in internal/schema/compare_schema.go...

func EnumEqual added in v0.0.38

func EnumEqual(e1, e2 *Enum) bool

func EnumsEqual added in v0.0.38

func EnumsEqual(l1, l2 []*Enum) bool

func GQLEnumEqual added in v0.0.38

func GQLEnumEqual(e1, e2 *GQLEnum) bool

func GQLEnumsEqual added in v0.0.38

func GQLEnumsEqual(l1, l2 []*GQLEnum) bool

func GetEnums

func GetEnums(input *Input) (*Enum, *GQLEnum)

func GetTSEnumNameForVal

func GetTSEnumNameForVal(val string) string

func GetTSEnumNameForValInfo added in v0.1.0

func GetTSEnumNameForValInfo(val string) (string, bool)

Types

type Data

type Data struct {
	Name        string
	Value       interface{}
	Comment     string
	PackagePath string
	UnknownVal  bool
}

type Enum

type Enum struct {
	Name             string
	Values           []*Data
	DeprecatedValues []*Data
	Imported         bool // Imported enum that's not in this file. TODO aren't all enums Imported now now??

	DisableUnknownType bool
	// contains filtered or unexported fields
}

func (*Enum) Clone added in v0.0.37

func (c *Enum) Clone() *Enum

func (*Enum) GetConvertFunctionInfo added in v0.1.0

func (c *Enum) GetConvertFunctionInfo() *convertFunctionInfo

func (*Enum) GetEnumValues added in v0.1.0

func (c *Enum) GetEnumValues() []interface{}

type GQLEnum

type GQLEnum struct {
	Name             string // Name is the name of the enum
	Type             string // type of the enum e.g. nullable or not
	Values           []*Data
	DeprecatedValues []*Data
}

func (*GQLEnum) Clone added in v0.1.0

func (c *GQLEnum) Clone() *GQLEnum

func (GQLEnum) GetGraphQLNames added in v0.0.33

func (g GQLEnum) GetGraphQLNames() []string

func (GQLEnum) GetGraphQLType added in v0.1.0

func (g GQLEnum) GetGraphQLType() string

type Input added in v0.0.29

type Input struct {
	TSName               string
	GQLName              string
	GQLType              string
	Values               []string
	EnumMap              map[string]string
	IntEnumMap           map[string]int
	DeprecatedIntEnumMap map[string]int
	DisableUnknownType   bool
}

func NewInputFromEnumType added in v0.1.0

func NewInputFromEnumType(enumType enttype.EnumeratedType, fkey bool) (*Input, error)

func (*Input) HasValues added in v0.0.29

func (i *Input) HasValues() bool

Jump to

Keyboard shortcuts

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