customtype

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: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompareInterfacesMapEqual

func CompareInterfacesMapEqual(m1, m2 map[string]*CustomInterface) bool

func CustomInterfaceEqual

func CustomInterfaceEqual(ci1, ci2 *CustomInterface) bool

func CustomUnionEqual

func CustomUnionEqual(cu1, cu2 *CustomUnion) bool

Types

type ConvertMethodInfo

type ConvertMethodInfo struct {
	Method         string
	NullableMethod string
	Infos          []NarrowingInfo
	Default        string
}

type CustomInterface

type CustomInterface struct {
	TSType       string
	GQLName      string
	Fields       []*field.Field
	NonEntFields []*field.NonEntField

	// if present, means that this interface should be imported in GraphQL instead...
	// interface{} to avoid circular dependencies
	Action interface{}

	// if part of input, we store GraphQLFieldName here and use it later on.
	GraphQLFieldName string

	// children of this interface. could be other interfaces or unions
	Children []CustomType

	// right now they're all exported??
	Exported bool

	GenerateListConvert bool
	// contains filtered or unexported fields
}

func (*CustomInterface) AddEnum

func (ci *CustomInterface) AddEnum(tsEnum *enum.Enum, gqlEnum *enum.GQLEnum)

func (*CustomInterface) Equal

func (ci *CustomInterface) Equal(ct CustomType) bool

func (*CustomInterface) ForeignImport

func (ci *CustomInterface) ForeignImport(typ string) bool

func (*CustomInterface) GetAllCustomTypes

func (ci *CustomInterface) GetAllCustomTypes() []CustomType

func (*CustomInterface) GetAllEnums

func (ci *CustomInterface) GetAllEnums() []*enum.Enum

func (*CustomInterface) GetConvertListMethod

func (ci *CustomInterface) GetConvertListMethod() string

func (*CustomInterface) GetConvertMethod

func (ci *CustomInterface) GetConvertMethod() string

note the logic for these 4 duplicated in Field.GetConvertMethod() in field_type.go

func (*CustomInterface) GetConvertNullableListMethod

func (ci *CustomInterface) GetConvertNullableListMethod() string

func (*CustomInterface) GetConvertNullableMethod

func (ci *CustomInterface) GetConvertNullableMethod() string

func (*CustomInterface) GetGraphQLEnums

func (ci *CustomInterface) GetGraphQLEnums() []*enum.GQLEnum

func (*CustomInterface) GetGraphQLName

func (ci *CustomInterface) GetGraphQLName() string

func (*CustomInterface) GetGraphQLType

func (ci *CustomInterface) GetGraphQLType() string

func (*CustomInterface) GetTSEnums

func (ci *CustomInterface) GetTSEnums() []*enum.Enum

local enums

func (*CustomInterface) GetTSType

func (ci *CustomInterface) GetTSType() string

func (*CustomInterface) GetTSTypes

func (ci *CustomInterface) GetTSTypes() []string

func (*CustomInterface) HasConvertFunction

func (ci *CustomInterface) HasConvertFunction(cfg codegenapi.Config) bool

func (*CustomInterface) IsCustomInterface

func (ci *CustomInterface) IsCustomInterface() bool

func (*CustomInterface) IsCustomUnion

func (ci *CustomInterface) IsCustomUnion() bool

type CustomType

type CustomType interface {
	field.CustomTypeWithHasConvertFunction
	GetTSType() string
	GetGraphQLName() string
	GetGraphQLType() string
	IsCustomInterface() bool
	IsCustomUnion() bool
	GetTSTypes() []string
	GetAllEnums() []*enum.Enum
	// put self last because you can reference
	// want to render in order so that dependencies are rendered first
	GetAllCustomTypes() []CustomType
	Equal(ct CustomType) bool
}

type CustomUnion

type CustomUnion struct {
	TSType     string
	GQLName    string
	Interfaces []*CustomInterface
}

func (*CustomUnion) Equal

func (cu *CustomUnion) Equal(ct CustomType) bool

func (*CustomUnion) GetAllCustomTypes

func (cu *CustomUnion) GetAllCustomTypes() []CustomType

func (*CustomUnion) GetAllEnums

func (ci *CustomUnion) GetAllEnums() []*enum.Enum

func (*CustomUnion) GetConvertMethod

func (cu *CustomUnion) GetConvertMethod() string

func (*CustomUnion) GetConvertMethodInfo

func (cu *CustomUnion) GetConvertMethodInfo(cfg codegenapi.Config) (*ConvertMethodInfo, error)

need all but one to be set

func (*CustomUnion) GetConvertNullableMethod

func (cu *CustomUnion) GetConvertNullableMethod() string

func (*CustomUnion) GetGraphQLName

func (cu *CustomUnion) GetGraphQLName() string

func (*CustomUnion) GetGraphQLType

func (cu *CustomUnion) GetGraphQLType() string

func (*CustomUnion) GetTSType

func (cu *CustomUnion) GetTSType() string

func (*CustomUnion) GetTSTypes

func (cu *CustomUnion) GetTSTypes() []string

func (*CustomUnion) GetTypeDeclaration

func (cu *CustomUnion) GetTypeDeclaration() (string, error)

func (*CustomUnion) HasConvertFunction

func (cu *CustomUnion) HasConvertFunction(cfg codegenapi.Config) bool

func (*CustomUnion) IsCustomInterface

func (cu *CustomUnion) IsCustomInterface() bool

func (*CustomUnion) IsCustomUnion

func (cu *CustomUnion) IsCustomUnion() bool

type NarrowingInfo

type NarrowingInfo struct {
	Field              string
	ReturnFunction     string
	HasConvertFunction bool
}

Jump to

Keyboard shortcuts

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