enttype

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertFuncs added in v0.1.0

func ConvertFuncs(t Type, s SchemaType) []string

func ConvertImportPaths added in v0.1.0

func ConvertImportPaths(t Type, s SchemaType) []*tsimport.ImportPath

func IsIDType added in v0.0.30

func IsIDType(t Type) bool

func IsImportDepsType

func IsImportDepsType(t Type) bool

func IsJSONBType added in v0.1.0

func IsJSONBType(t Type) bool

func IsListType

func IsListType(t Type) bool

TODO need an interface for this

func IsNullable added in v0.1.0

func IsNullable(t Type) bool

func IsStringDBType added in v0.1.0

func IsStringDBType(t Type) bool

Types

type ActionFieldsInfo added in v0.0.35

type ActionFieldsInfo struct {
	ActionName     string
	ExcludedFields []string
}

type ArrayListType

type ArrayListType struct {
	ElemType           TSType
	ElemDBTypeNotArray bool
	// contains filtered or unexported fields
}

func (*ArrayListType) ArgImports added in v0.1.0

func (t *ArrayListType) ArgImports(cfg Config) []*tsimport.ImportPath

func (*ArrayListType) Convert

func (*ArrayListType) CustomGQLRender added in v0.1.0

func (t *ArrayListType) CustomGQLRender(cfg Config, v string) string

func (*ArrayListType) GetCustomTypeInfo added in v0.1.0

func (t *ArrayListType) GetCustomTypeInfo() *CustomTypeInfo

func (*ArrayListType) GetDBType

func (t *ArrayListType) GetDBType() string

func (*ArrayListType) GetGraphQLType

func (t *ArrayListType) GetGraphQLType() string

func (*ArrayListType) GetImportDepsType added in v0.1.0

func (t *ArrayListType) GetImportDepsType() *tsimport.ImportPath

func (*ArrayListType) GetNullableType

func (t *ArrayListType) GetNullableType() TSType

func (*ArrayListType) GetSubFields added in v0.1.0

func (t *ArrayListType) GetSubFields() interface{}

func (*ArrayListType) GetTSGraphQLImports

func (t *ArrayListType) GetTSGraphQLImports(input bool) []*tsimport.ImportPath

func (*ArrayListType) GetTSType

func (t *ArrayListType) GetTSType() string

func (*ArrayListType) GetTsTypeImports

func (t *ArrayListType) GetTsTypeImports() []*tsimport.ImportPath

type BigIntImport

type BigIntImport struct {
	// contains filtered or unexported fields
}

func (*BigIntImport) Aliases

func (imp *BigIntImport) Aliases() []string

func (*BigIntImport) DefaultImport

func (b *BigIntImport) DefaultImport() bool

func (*BigIntImport) Import

func (imp *BigIntImport) Import() string

func (*BigIntImport) ImportPath

func (b *BigIntImport) ImportPath() string

type BigIntegerType

type BigIntegerType struct {
	IntegerType
}

func (*BigIntegerType) Convert

func (*BigIntegerType) GetDBType

func (t *BigIntegerType) GetDBType() string

func (*BigIntegerType) GetGraphQLType

func (t *BigIntegerType) GetGraphQLType() string

func (*BigIntegerType) GetImportType

func (t *BigIntegerType) GetImportType() Import

func (*BigIntegerType) GetNullableType

func (t *BigIntegerType) GetNullableType() TSType

func (*BigIntegerType) GetRelativeMathInfo added in v0.1.0

func (t *BigIntegerType) GetRelativeMathInfo() *RelativeMathInfo

func (*BigIntegerType) GetTSGraphQLImports

func (t *BigIntegerType) GetTSGraphQLImports(input bool) []*tsimport.ImportPath

func (*BigIntegerType) GetTSType

func (t *BigIntegerType) GetTSType() string

type BinaryTextType added in v0.1.8

type BinaryTextType struct {
	ByteaType
}

func (*BinaryTextType) Convert added in v0.1.8

func (*BinaryTextType) GetDBType added in v0.1.8

func (t *BinaryTextType) GetDBType() string

func (*BinaryTextType) GetNullableType added in v0.1.8

func (t *BinaryTextType) GetNullableType() TSType

type BoolImport

type BoolImport struct {
	// contains filtered or unexported fields
}

func (*BoolImport) Aliases

func (imp *BoolImport) Aliases() []string

func (*BoolImport) DefaultImport

func (b *BoolImport) DefaultImport() bool

func (*BoolImport) Import

func (imp *BoolImport) Import() string

func (*BoolImport) ImportPath

func (b *BoolImport) ImportPath() string

type BoolType

type BoolType struct {
	// contains filtered or unexported fields
}

func (*BoolType) Convert

func (t *BoolType) Convert(s SchemaType) ConvertDataTypeRet

func (*BoolType) GetDBType

func (t *BoolType) GetDBType() string

func (*BoolType) GetGraphQLType

func (t *BoolType) GetGraphQLType() string

func (*BoolType) GetImportType

func (t *BoolType) GetImportType() Import

func (*BoolType) GetNullableType

func (t *BoolType) GetNullableType() TSType

func (*BoolType) GetTSGraphQLImports

func (t *BoolType) GetTSGraphQLImports(input bool) []*tsimport.ImportPath

func (*BoolType) GetTSType

func (t *BoolType) GetTSType() string

type ByteaType added in v0.1.8

type ByteaType struct {
}

func (*ByteaType) GetDBType added in v0.1.8

func (t *ByteaType) GetDBType() string

func (*ByteaType) GetGraphQLType added in v0.1.8

func (t *ByteaType) GetGraphQLType() string

func (*ByteaType) GetNullableType added in v0.1.8

func (t *ByteaType) GetNullableType() TSType

only need these for the string text one convertNullableTextToBuffer

func (t *ByteaType) Convert(s SchemaType) ConvertDataTypeRet {
	return getAllDialectsImportMap(tsimport.NewEntImportPath("convertTextToBuffer"))
}

func (*ByteaType) GetTSGraphQLImports added in v0.1.8

func (t *ByteaType) GetTSGraphQLImports(input bool) []*tsimport.ImportPath

func (*ByteaType) GetTSType added in v0.1.8

func (t *ByteaType) GetTSType() string

func (*ByteaType) GetTsTypeImports added in v0.1.8

func (t *ByteaType) GetTsTypeImports() []*tsimport.ImportPath

type CommonJSONType added in v0.1.0

type CommonJSONType struct {
	ImportType *tsimport.ImportPath
	// input SubFields. not typed because of circular dependencies
	SubFields              interface{}
	UnionFields            interface{}
	CustomTsInterface      string
	CustomGraphQLInterface string
	GlobalType             string
}

func (*CommonJSONType) GetCustomGraphQLInterface added in v0.1.0

func (t *CommonJSONType) GetCustomGraphQLInterface() string

func (*CommonJSONType) GetCustomTypeInfo added in v0.1.0

func (t *CommonJSONType) GetCustomTypeInfo() *CustomTypeInfo

func (*CommonJSONType) GetGraphQLType added in v0.1.0

func (t *CommonJSONType) GetGraphQLType() string

func (*CommonJSONType) GetImportDepsType added in v0.1.0

func (t *CommonJSONType) GetImportDepsType() *tsimport.ImportPath

func (*CommonJSONType) GetImportType added in v0.1.0

func (t *CommonJSONType) GetImportType() Import

func (*CommonJSONType) GetSubFields added in v0.1.0

func (t *CommonJSONType) GetSubFields() interface{}

func (*CommonJSONType) GetTsTypeImports added in v0.1.0

func (t *CommonJSONType) GetTsTypeImports() []*tsimport.ImportPath

func (*CommonJSONType) GetUnionFields added in v0.1.0

func (t *CommonJSONType) GetUnionFields() interface{}

type CommonObjectType

type CommonObjectType struct {
	TSType         string
	GraphQLType    string
	ActionName     string
	ExcludedFields []string
}

public for tests

func (*CommonObjectType) GetActionFieldsInfo added in v0.0.35

func (t *CommonObjectType) GetActionFieldsInfo() *ActionFieldsInfo

func (*CommonObjectType) GetCustomTypeInfo added in v0.1.0

func (t *CommonObjectType) GetCustomTypeInfo() *CustomTypeInfo

func (*CommonObjectType) GetDBType

func (t *CommonObjectType) GetDBType() string

type Config added in v0.0.35

type Config interface {
	Base64EncodeIDs() bool
}

type ConvertDataType

type ConvertDataType interface {
	TSType
	// return convert info for each dialect. a lot of these only apply for one dialect
	Convert(s SchemaType) ConvertDataTypeRet
}

type ConvertDataTypeRet added in v0.1.0

type ConvertDataTypeRet map[config.Dialect][]*tsimport.ImportPath

type CustomGQLRenderer added in v0.0.35

type CustomGQLRenderer interface {
	TSType
	CustomGQLRender(cfg Config, v string) string
	ArgImports(cfg Config) []*tsimport.ImportPath
}

rendering of fields in actions e.g. converting a graphql id to ent id or converting say an enum value from graphql to Node representation if said conversion was not supported natively

type CustomType added in v0.1.0

type CustomType string
const (
	CustomInterface CustomType = "custom_interface"
	CustomUnion     CustomType = "custom_union"
)

type CustomTypeInfo added in v0.1.0

type CustomTypeInfo struct {
	TSInterface      string
	GraphQLInterface string
	Type             CustomType
}

type DateImport

type DateImport struct {
	// contains filtered or unexported fields
}

func (*DateImport) Aliases

func (imp *DateImport) Aliases() []string

func (*DateImport) DefaultImport

func (b *DateImport) DefaultImport() bool

func (*DateImport) Import

func (imp *DateImport) Import() string

func (*DateImport) ImportPath

func (b *DateImport) ImportPath() string

type DateType

type DateType struct {
	TimestampType
}

func (*DateType) Convert

func (t *DateType) Convert(s SchemaType) ConvertDataTypeRet

func (*DateType) GetDBType

func (t *DateType) GetDBType() string

func (*DateType) GetImportType

func (t *DateType) GetImportType() Import

func (*DateType) GetNullableType

func (t *DateType) GetNullableType() TSType

type EmailImport

type EmailImport struct {
	// contains filtered or unexported fields
}

func (*EmailImport) Aliases

func (imp *EmailImport) Aliases() []string

func (*EmailImport) DefaultImport

func (b *EmailImport) DefaultImport() bool

func (*EmailImport) Import

func (imp *EmailImport) Import() string

func (*EmailImport) ImportPath

func (imp *EmailImport) ImportPath() string

type EmailType

type EmailType struct {
	StringType
}

func (*EmailType) GetDBType

func (t *EmailType) GetDBType() string

func (*EmailType) GetImportType

func (t *EmailType) GetImportType() Import

func (*EmailType) GetNullableType

func (t *EmailType) GetNullableType() TSType

type EnumData added in v0.1.0

type EnumData struct {
	// TSName refers to the name of the generated enum
	TSName               string
	GraphQLName          string
	Values               []string
	EnumMap              map[string]string
	IntEnumMap           map[string]int
	DeprecatedIntEnumMap map[string]int
	DisableUnknownType   bool
}

type EnumeratedType

type EnumeratedType interface {
	TSType
	GetEnumData() *EnumData
}

EnumeratedType indicates that this is an enum type

func GetEnumType

func GetEnumType(t Type) (EnumeratedType, bool)

this exists because we need to account for lists...

type FloatImport

type FloatImport struct {
	// contains filtered or unexported fields
}

func (*FloatImport) Aliases

func (imp *FloatImport) Aliases() []string

func (*FloatImport) DefaultImport

func (b *FloatImport) DefaultImport() bool

func (*FloatImport) Import

func (imp *FloatImport) Import() string

func (*FloatImport) ImportPath

func (b *FloatImport) ImportPath() string

type FloatType

type FloatType struct {
	// contains filtered or unexported fields
}

func (*FloatType) GetDBType

func (t *FloatType) GetDBType() string

func (*FloatType) GetGraphQLType

func (t *FloatType) GetGraphQLType() string

func (*FloatType) GetImportType

func (t *FloatType) GetImportType() Import

func (*FloatType) GetNullableType

func (t *FloatType) GetNullableType() TSType

func (*FloatType) GetTSGraphQLImports

func (t *FloatType) GetTSGraphQLImports(input bool) []*tsimport.ImportPath

func (*FloatType) GetTSType

func (t *FloatType) GetTSType() string

type IDType

type IDType struct {
	// contains filtered or unexported fields
}

UUIDType

func (*IDType) ArgImports added in v0.0.35

func (t *IDType) ArgImports(cfg Config) []*tsimport.ImportPath

func (*IDType) CustomGQLRender added in v0.0.35

func (t *IDType) CustomGQLRender(cfg Config, v string) string

func (*IDType) GetDBType

func (t *IDType) GetDBType() string

func (*IDType) GetGraphQLType

func (t *IDType) GetGraphQLType() string

func (*IDType) GetImportType

func (t *IDType) GetImportType() Import

func (*IDType) GetNullableType

func (t *IDType) GetNullableType() TSType

func (*IDType) GetTSGraphQLImports

func (t *IDType) GetTSGraphQLImports(input bool) []*tsimport.ImportPath

func (*IDType) GetTSType

func (t *IDType) GetTSType() string

func (*IDType) GetTsTypeImports

func (t *IDType) GetTsTypeImports() []*tsimport.ImportPath

func (*IDType) IsIDType

func (t *IDType) IsIDType() bool

type Import

type Import interface {
	ImportPath() string
	Import() string
	DefaultImport() bool
	Aliases() []string
}

func GetTypeForField

func GetTypeForField(s string) Import

func ValidateTypeForImport

func ValidateTypeForImport(s string) (Import, error)

type ImportDepsType

type ImportDepsType interface {
	TSType
	GetImportDepsType() *tsimport.ImportPath
}

type IntImport

type IntImport struct {
	// contains filtered or unexported fields
}

func (*IntImport) Aliases

func (imp *IntImport) Aliases() []string

func (*IntImport) DefaultImport

func (b *IntImport) DefaultImport() bool

func (*IntImport) Import

func (imp *IntImport) Import() string

func (*IntImport) ImportPath

func (b *IntImport) ImportPath() string

type IntegerEnumType added in v0.1.0

type IntegerEnumType struct {
	Type               string
	GraphQLType        string
	EnumMap            map[string]int
	DeprecatedEnumMap  map[string]int
	DisableUnknownType bool
	GlobalType         string
}

func (*IntegerEnumType) Convert added in v0.1.0

func (*IntegerEnumType) GetDBType added in v0.1.0

func (t *IntegerEnumType) GetDBType() string

func (*IntegerEnumType) GetEnumData added in v0.1.0

func (t *IntegerEnumType) GetEnumData() *EnumData

func (*IntegerEnumType) GetGraphQLType added in v0.1.0

func (t *IntegerEnumType) GetGraphQLType() string

func (*IntegerEnumType) GetNullableType added in v0.1.0

func (t *IntegerEnumType) GetNullableType() TSType

func (*IntegerEnumType) GetTSGraphQLImports added in v0.1.0

func (t *IntegerEnumType) GetTSGraphQLImports(input bool) []*tsimport.ImportPath

func (*IntegerEnumType) GetTSType added in v0.1.0

func (t *IntegerEnumType) GetTSType() string

func (*IntegerEnumType) GetTsTypeImports added in v0.1.0

func (t *IntegerEnumType) GetTsTypeImports() []*tsimport.ImportPath

type IntegerType

type IntegerType struct {
	// contains filtered or unexported fields
}

func (*IntegerType) GetDBType

func (t *IntegerType) GetDBType() string

func (*IntegerType) GetGraphQLType

func (t *IntegerType) GetGraphQLType() string

func (*IntegerType) GetImportType

func (t *IntegerType) GetImportType() Import

func (*IntegerType) GetNullableType

func (t *IntegerType) GetNullableType() TSType

func (*IntegerType) GetTSGraphQLImports

func (t *IntegerType) GetTSGraphQLImports(input bool) []*tsimport.ImportPath

func (*IntegerType) GetTSType

func (t *IntegerType) GetTSType() string

type JSONBImport

type JSONBImport struct {
	// contains filtered or unexported fields
}

func (*JSONBImport) Aliases

func (imp *JSONBImport) Aliases() []string

func (*JSONBImport) DefaultImport

func (b *JSONBImport) DefaultImport() bool

func (*JSONBImport) Import

func (imp *JSONBImport) Import() string

func (*JSONBImport) ImportPath

func (imp *JSONBImport) ImportPath() string

type JSONBType

type JSONBType struct {
	CommonJSONType
}

func (*JSONBType) Convert

func (t *JSONBType) Convert(s SchemaType) ConvertDataTypeRet

func (*JSONBType) GetDBType

func (t *JSONBType) GetDBType() string

func (*JSONBType) GetImportDepsType

func (t *JSONBType) GetImportDepsType() *tsimport.ImportPath

func (*JSONBType) GetImportType

func (t *JSONBType) GetImportType() Import

func (*JSONBType) GetNullableType

func (t *JSONBType) GetNullableType() TSType

func (*JSONBType) GetTSGraphQLImports

func (t *JSONBType) GetTSGraphQLImports(input bool) []*tsimport.ImportPath

func (*JSONBType) GetTSType

func (t *JSONBType) GetTSType() string

type JSONImport

type JSONImport struct {
	// contains filtered or unexported fields
}

func (*JSONImport) Aliases

func (imp *JSONImport) Aliases() []string

func (*JSONImport) DefaultImport

func (b *JSONImport) DefaultImport() bool

func (*JSONImport) Import

func (imp *JSONImport) Import() string

func (*JSONImport) ImportPath

func (imp *JSONImport) ImportPath() string

type JSONType

type JSONType struct {
	CommonJSONType
}

func (*JSONType) Convert

func (t *JSONType) Convert(s SchemaType) ConvertDataTypeRet

func (*JSONType) GetDBType

func (t *JSONType) GetDBType() string

func (*JSONType) GetImportDepsType

func (t *JSONType) GetImportDepsType() *tsimport.ImportPath

func (*JSONType) GetNullableType

func (t *JSONType) GetNullableType() TSType

func (*JSONType) GetTSGraphQLImports

func (t *JSONType) GetTSGraphQLImports(input bool) []*tsimport.ImportPath

func (*JSONType) GetTSType

func (t *JSONType) GetTSType() string

type ListWrapperType

type ListWrapperType struct {
	Type TSType
	// doesn't care if content is nullable. that's handled by Type passed...
	Nullable bool
}

func (*ListWrapperType) GetActionFieldsInfo added in v0.0.35

func (t *ListWrapperType) GetActionFieldsInfo() *ActionFieldsInfo

func (*ListWrapperType) GetCustomTypeInfo added in v0.1.0

func (t *ListWrapperType) GetCustomTypeInfo() *CustomTypeInfo

func (*ListWrapperType) GetDBType

func (t *ListWrapperType) GetDBType() string

func (*ListWrapperType) GetGraphQLType

func (t *ListWrapperType) GetGraphQLType() string

func (*ListWrapperType) GetImportDepsType added in v0.1.0

func (t *ListWrapperType) GetImportDepsType() *tsimport.ImportPath

func (*ListWrapperType) GetNonNullableType

func (t *ListWrapperType) GetNonNullableType() TSType

func (*ListWrapperType) GetNullableType

func (t *ListWrapperType) GetNullableType() TSType

func (*ListWrapperType) GetTSGraphQLImports

func (t *ListWrapperType) GetTSGraphQLImports(input bool) []*tsimport.ImportPath

func (*ListWrapperType) GetTSType

func (t *ListWrapperType) GetTSType() string

func (*ListWrapperType) GetTsTypeImports added in v0.1.0

func (t *ListWrapperType) GetTsTypeImports() []*tsimport.ImportPath

type NonNullableType

type NonNullableType interface {
	TSType
	GetNonNullableType() TSType
}

type NullableArrayListType

type NullableArrayListType struct {
	ElemType           TSType
	ElemDBTypeNotArray bool
	// contains filtered or unexported fields
}

func (*NullableArrayListType) ArgImports added in v0.1.0

func (t *NullableArrayListType) ArgImports(cfg Config) []*tsimport.ImportPath

func (*NullableArrayListType) Convert

TODO why is there ListWrapperType (for ActionFields) and NullableArrayListType /ArrayListType for regular lists? TODO GetCustomTypeInfo

func (*NullableArrayListType) CustomGQLRender added in v0.1.0

func (t *NullableArrayListType) CustomGQLRender(cfg Config, v string) string

func (*NullableArrayListType) GetCustomTypeInfo added in v0.1.0

func (t *NullableArrayListType) GetCustomTypeInfo() *CustomTypeInfo

func (*NullableArrayListType) GetDBType

func (t *NullableArrayListType) GetDBType() string

func (*NullableArrayListType) GetGraphQLType

func (t *NullableArrayListType) GetGraphQLType() string

func (*NullableArrayListType) GetImportDepsType added in v0.1.0

func (t *NullableArrayListType) GetImportDepsType() *tsimport.ImportPath

func (*NullableArrayListType) GetNonNullableType

func (t *NullableArrayListType) GetNonNullableType() TSType

func (*NullableArrayListType) GetSubFields added in v0.1.0

func (t *NullableArrayListType) GetSubFields() interface{}

func (*NullableArrayListType) GetTSGraphQLImports

func (t *NullableArrayListType) GetTSGraphQLImports(input bool) []*tsimport.ImportPath

func (*NullableArrayListType) GetTSType

func (t *NullableArrayListType) GetTSType() string

func (*NullableArrayListType) GetTsTypeImports

func (t *NullableArrayListType) GetTsTypeImports() []*tsimport.ImportPath

type NullableBigIntegerType

type NullableBigIntegerType struct {
	NullableIntegerType
}

what's the best graphql representation? for now we'll use strings but there's a few graphql representations on the Internet

func (*NullableBigIntegerType) Convert

func (*NullableBigIntegerType) GetDBType

func (t *NullableBigIntegerType) GetDBType() string

func (*NullableBigIntegerType) GetGraphQLType

func (t *NullableBigIntegerType) GetGraphQLType() string

func (*NullableBigIntegerType) GetImportType

func (t *NullableBigIntegerType) GetImportType() Import

func (*NullableBigIntegerType) GetNonNullableType

func (t *NullableBigIntegerType) GetNonNullableType() TSType

func (*NullableBigIntegerType) GetRelativeMathInfo added in v0.1.0

func (t *NullableBigIntegerType) GetRelativeMathInfo() *RelativeMathInfo

func (*NullableBigIntegerType) GetTSGraphQLImports

func (t *NullableBigIntegerType) GetTSGraphQLImports(input bool) []*tsimport.ImportPath

func (*NullableBigIntegerType) GetTSType

func (t *NullableBigIntegerType) GetTSType() string

type NullableBinaryTextType added in v0.1.8

type NullableBinaryTextType struct {
	NullableByteaType
}

func (*NullableBinaryTextType) Convert added in v0.1.8

func (*NullableBinaryTextType) GetDBType added in v0.1.8

func (t *NullableBinaryTextType) GetDBType() string

func (*NullableBinaryTextType) GetNonNullableType added in v0.1.8

func (t *NullableBinaryTextType) GetNonNullableType() TSType

type NullableBoolType

type NullableBoolType struct {
	// contains filtered or unexported fields
}

func (*NullableBoolType) Convert

func (*NullableBoolType) GetDBType

func (t *NullableBoolType) GetDBType() string

func (*NullableBoolType) GetGraphQLType

func (t *NullableBoolType) GetGraphQLType() string

func (*NullableBoolType) GetImportType

func (t *NullableBoolType) GetImportType() Import

func (*NullableBoolType) GetNonNullableType

func (t *NullableBoolType) GetNonNullableType() TSType

func (*NullableBoolType) GetTSGraphQLImports

func (t *NullableBoolType) GetTSGraphQLImports(input bool) []*tsimport.ImportPath

func (*NullableBoolType) GetTSType

func (t *NullableBoolType) GetTSType() string

type NullableByteaType added in v0.1.8

type NullableByteaType struct {
}

func (*NullableByteaType) GetDBType added in v0.1.8

func (t *NullableByteaType) GetDBType() string

func (*NullableByteaType) GetGraphQLType added in v0.1.8

func (t *NullableByteaType) GetGraphQLType() string

func (*NullableByteaType) GetNonNullableType added in v0.1.8

func (t *NullableByteaType) GetNonNullableType() TSType

func (*NullableByteaType) GetTSGraphQLImports added in v0.1.8

func (t *NullableByteaType) GetTSGraphQLImports(input bool) []*tsimport.ImportPath

func (*NullableByteaType) GetTSType added in v0.1.8

func (t *NullableByteaType) GetTSType() string

func (*NullableByteaType) GetTsTypeImports added in v0.1.8

func (t *NullableByteaType) GetTsTypeImports() []*tsimport.ImportPath

type NullableDateType

type NullableDateType struct {
	NullableTimestampType
}

func (*NullableDateType) GetDBType

func (t *NullableDateType) GetDBType() string

func (*NullableDateType) GetImportType

func (t *NullableDateType) GetImportType() Import

func (*NullableDateType) GetNonNullableType

func (t *NullableDateType) GetNonNullableType() TSType

type NullableEmailType

type NullableEmailType struct {
	NullableStringType
}

func (*NullableEmailType) GetDBType

func (t *NullableEmailType) GetDBType() string

func (*NullableEmailType) GetImportType

func (t *NullableEmailType) GetImportType() Import

func (*NullableEmailType) GetNonNullableType

func (t *NullableEmailType) GetNonNullableType() TSType

type NullableFloatType

type NullableFloatType struct {
	// contains filtered or unexported fields
}

func (*NullableFloatType) GetDBType

func (t *NullableFloatType) GetDBType() string

func (*NullableFloatType) GetGraphQLType

func (t *NullableFloatType) GetGraphQLType() string

func (*NullableFloatType) GetImportType

func (t *NullableFloatType) GetImportType() Import

func (*NullableFloatType) GetNonNullableType

func (t *NullableFloatType) GetNonNullableType() TSType

func (*NullableFloatType) GetTSGraphQLImports

func (t *NullableFloatType) GetTSGraphQLImports(input bool) []*tsimport.ImportPath

func (*NullableFloatType) GetTSType

func (t *NullableFloatType) GetTSType() string

type NullableIDType

type NullableIDType struct {
	// contains filtered or unexported fields
}

func (*NullableIDType) ArgImports added in v0.0.35

func (t *NullableIDType) ArgImports(cfg Config) []*tsimport.ImportPath

func (*NullableIDType) CustomGQLRender added in v0.0.35

func (t *NullableIDType) CustomGQLRender(cfg Config, v string) string

func (*NullableIDType) GetDBType

func (t *NullableIDType) GetDBType() string

func (*NullableIDType) GetGraphQLType

func (t *NullableIDType) GetGraphQLType() string

func (*NullableIDType) GetImportType

func (t *NullableIDType) GetImportType() Import

func (*NullableIDType) GetNonNullableType

func (t *NullableIDType) GetNonNullableType() TSType

func (*NullableIDType) GetTSGraphQLImports

func (t *NullableIDType) GetTSGraphQLImports(input bool) []*tsimport.ImportPath

func (*NullableIDType) GetTSType

func (t *NullableIDType) GetTSType() string

func (*NullableIDType) GetTsTypeImports

func (t *NullableIDType) GetTsTypeImports() []*tsimport.ImportPath

func (*NullableIDType) IsIDType

func (t *NullableIDType) IsIDType() bool

type NullableIntegerEnumType added in v0.1.0

type NullableIntegerEnumType struct {
	Type               string
	GraphQLType        string
	EnumMap            map[string]int
	DeprecatedEnumMap  map[string]int
	DisableUnknownType bool
	GlobalType         string
}

func (*NullableIntegerEnumType) Convert added in v0.1.0

func (*NullableIntegerEnumType) GetDBType added in v0.1.0

func (t *NullableIntegerEnumType) GetDBType() string

func (*NullableIntegerEnumType) GetEnumData added in v0.1.0

func (t *NullableIntegerEnumType) GetEnumData() *EnumData

func (*NullableIntegerEnumType) GetGraphQLType added in v0.1.0

func (t *NullableIntegerEnumType) GetGraphQLType() string

func (*NullableIntegerEnumType) GetNonNullableType added in v0.1.0

func (t *NullableIntegerEnumType) GetNonNullableType() TSType

func (*NullableIntegerEnumType) GetTSGraphQLImports added in v0.1.0

func (t *NullableIntegerEnumType) GetTSGraphQLImports(input bool) []*tsimport.ImportPath

func (*NullableIntegerEnumType) GetTSType added in v0.1.0

func (t *NullableIntegerEnumType) GetTSType() string

func (*NullableIntegerEnumType) GetTsTypeImports added in v0.1.0

func (t *NullableIntegerEnumType) GetTsTypeImports() []*tsimport.ImportPath

type NullableIntegerType

type NullableIntegerType struct {
	// contains filtered or unexported fields
}

func (*NullableIntegerType) GetDBType

func (t *NullableIntegerType) GetDBType() string

func (*NullableIntegerType) GetGraphQLType

func (t *NullableIntegerType) GetGraphQLType() string

func (*NullableIntegerType) GetImportType

func (t *NullableIntegerType) GetImportType() Import

func (*NullableIntegerType) GetNonNullableType

func (t *NullableIntegerType) GetNonNullableType() TSType

func (*NullableIntegerType) GetTSGraphQLImports

func (t *NullableIntegerType) GetTSGraphQLImports(input bool) []*tsimport.ImportPath

func (*NullableIntegerType) GetTSType

func (t *NullableIntegerType) GetTSType() string

type NullableJSONBType

type NullableJSONBType struct {
	CommonJSONType
}

func (*NullableJSONBType) Convert

func (*NullableJSONBType) GetDBType

func (t *NullableJSONBType) GetDBType() string

func (*NullableJSONBType) GetGraphQLType

func (t *NullableJSONBType) GetGraphQLType() string

func (*NullableJSONBType) GetImportType

func (t *NullableJSONBType) GetImportType() Import

func (*NullableJSONBType) GetNonNullableType

func (t *NullableJSONBType) GetNonNullableType() TSType

func (*NullableJSONBType) GetTSGraphQLImports

func (t *NullableJSONBType) GetTSGraphQLImports(input bool) []*tsimport.ImportPath

func (*NullableJSONBType) GetTSType

func (t *NullableJSONBType) GetTSType() string

type NullableJSONType

type NullableJSONType struct {
	CommonJSONType
}

func (*NullableJSONType) Convert

func (*NullableJSONType) GetDBType

func (t *NullableJSONType) GetDBType() string

func (*NullableJSONType) GetGraphQLType

func (t *NullableJSONType) GetGraphQLType() string

func (*NullableJSONType) GetImportDepsType

func (t *NullableJSONType) GetImportDepsType() *tsimport.ImportPath

func (*NullableJSONType) GetNonNullableType

func (t *NullableJSONType) GetNonNullableType() TSType

func (*NullableJSONType) GetTSGraphQLImports

func (t *NullableJSONType) GetTSGraphQLImports(input bool) []*tsimport.ImportPath

func (*NullableJSONType) GetTSType

func (t *NullableJSONType) GetTSType() string

type NullableObjectType

type NullableObjectType struct {
	CommonObjectType
}

func (*NullableObjectType) GetGraphQLType

func (t *NullableObjectType) GetGraphQLType() string

func (*NullableObjectType) GetNullableType

func (t *NullableObjectType) GetNullableType() TSType

func (*NullableObjectType) GetTSGraphQLImports

func (t *NullableObjectType) GetTSGraphQLImports(input bool) []*tsimport.ImportPath

func (*NullableObjectType) GetTSType

func (t *NullableObjectType) GetTSType() string

type NullablePasswordType

type NullablePasswordType struct {
	NullableStringType
}

func (*NullablePasswordType) GetDBType

func (t *NullablePasswordType) GetDBType() string

func (*NullablePasswordType) GetImportType

func (t *NullablePasswordType) GetImportType() Import

func (*NullablePasswordType) GetNonNullableType

func (t *NullablePasswordType) GetNonNullableType() TSType

type NullablePhoneType

type NullablePhoneType struct {
	NullableStringType
}

func (*NullablePhoneType) GetDBType

func (t *NullablePhoneType) GetDBType() string

func (*NullablePhoneType) GetImportType

func (t *NullablePhoneType) GetImportType() Import

func (*NullablePhoneType) GetNonNullableType

func (t *NullablePhoneType) GetNonNullableType() TSType

type NullableStringEnumType added in v0.1.0

type NullableStringEnumType struct {
	EnumDBType         bool
	Type               string
	GraphQLType        string
	Values             []string
	EnumMap            map[string]string
	DisableUnknownType bool
	GlobalType         string
	// contains filtered or unexported fields
}

func (*NullableStringEnumType) Convert added in v0.1.0

func (*NullableStringEnumType) GetDBType added in v0.1.0

func (t *NullableStringEnumType) GetDBType() string

func (*NullableStringEnumType) GetEnumData added in v0.1.0

func (t *NullableStringEnumType) GetEnumData() *EnumData

func (*NullableStringEnumType) GetGraphQLType added in v0.1.0

func (t *NullableStringEnumType) GetGraphQLType() string

func (*NullableStringEnumType) GetNonNullableType added in v0.1.0

func (t *NullableStringEnumType) GetNonNullableType() TSType

func (*NullableStringEnumType) GetTSGraphQLImports added in v0.1.0

func (t *NullableStringEnumType) GetTSGraphQLImports(input bool) []*tsimport.ImportPath

func (*NullableStringEnumType) GetTSType added in v0.1.0

func (t *NullableStringEnumType) GetTSType() string

func (*NullableStringEnumType) GetTsTypeImports added in v0.1.0

func (t *NullableStringEnumType) GetTsTypeImports() []*tsimport.ImportPath

type NullableStringType

type NullableStringType struct {
	// contains filtered or unexported fields
}

func (*NullableStringType) GetDBType

func (t *NullableStringType) GetDBType() string

func (*NullableStringType) GetGraphQLType

func (t *NullableStringType) GetGraphQLType() string

func (*NullableStringType) GetImportType

func (t *NullableStringType) GetImportType() Import

func (*NullableStringType) GetNonNullableType

func (t *NullableStringType) GetNonNullableType() TSType

func (*NullableStringType) GetTSGraphQLImports

func (t *NullableStringType) GetTSGraphQLImports(input bool) []*tsimport.ImportPath

func (*NullableStringType) GetTSType

func (t *NullableStringType) GetTSType() string

type NullableTimeType

type NullableTimeType struct {
	// contains filtered or unexported fields
}

func (*NullableTimeType) GetDBType

func (t *NullableTimeType) GetDBType() string

func (*NullableTimeType) GetGraphQLType

func (t *NullableTimeType) GetGraphQLType() string

func (*NullableTimeType) GetImportType

func (t *NullableTimeType) GetImportType() Import

func (*NullableTimeType) GetNonNullableType

func (t *NullableTimeType) GetNonNullableType() TSType

func (*NullableTimeType) GetTSGraphQLImports

func (t *NullableTimeType) GetTSGraphQLImports(input bool) []*tsimport.ImportPath

func (*NullableTimeType) GetTSType

func (t *NullableTimeType) GetTSType() string

type NullableTimestampType

type NullableTimestampType struct {
	// contains filtered or unexported fields
}

func (*NullableTimestampType) Convert

func (*NullableTimestampType) GetDBType

func (t *NullableTimestampType) GetDBType() string

func (*NullableTimestampType) GetGraphQLType

func (t *NullableTimestampType) GetGraphQLType() string

func (*NullableTimestampType) GetImportType

func (t *NullableTimestampType) GetImportType() Import

func (*NullableTimestampType) GetNonNullableType

func (t *NullableTimestampType) GetNonNullableType() TSType

func (*NullableTimestampType) GetTSGraphQLImports

func (t *NullableTimestampType) GetTSGraphQLImports(input bool) []*tsimport.ImportPath

func (*NullableTimestampType) GetTSType

func (t *NullableTimestampType) GetTSType() string

type NullableTimestamptzType

type NullableTimestamptzType struct {
	NullableTimestampType
}

func (*NullableTimestamptzType) GetDBType

func (t *NullableTimestamptzType) GetDBType() string

func (*NullableTimestamptzType) GetImportType

func (t *NullableTimestamptzType) GetImportType() Import

func (*NullableTimestamptzType) GetNonNullableType

func (t *NullableTimestamptzType) GetNonNullableType() TSType

type NullableTimetzType

type NullableTimetzType struct {
	NullableTimeType
}

func (*NullableTimetzType) GetDBType

func (t *NullableTimetzType) GetDBType() string

func (*NullableTimetzType) GetImportType

func (t *NullableTimetzType) GetImportType() Import

func (*NullableTimetzType) GetNonNullableType

func (t *NullableTimetzType) GetNonNullableType() TSType

type NullableType

type NullableType interface {
	TSType
	GetNullableType() TSType
}

NullableType refers to a Type that has the nullable version of the same type

type ObjectType

type ObjectType struct {
	CommonObjectType
}

func (*ObjectType) GetGraphQLType

func (t *ObjectType) GetGraphQLType() string

func (*ObjectType) GetNullableType

func (t *ObjectType) GetNullableType() TSType

func (*ObjectType) GetTSGraphQLImports

func (t *ObjectType) GetTSGraphQLImports(input bool) []*tsimport.ImportPath

func (*ObjectType) GetTSType

func (t *ObjectType) GetTSType() string

type PasswordImport

type PasswordImport struct {
	// contains filtered or unexported fields
}

func (*PasswordImport) Aliases

func (imp *PasswordImport) Aliases() []string

func (*PasswordImport) DefaultImport

func (b *PasswordImport) DefaultImport() bool

func (*PasswordImport) Import

func (imp *PasswordImport) Import() string

func (*PasswordImport) ImportPath

func (imp *PasswordImport) ImportPath() string

type PasswordType

type PasswordType struct {
	StringType
}

func (*PasswordType) GetDBType

func (t *PasswordType) GetDBType() string

func (*PasswordType) GetImportType

func (t *PasswordType) GetImportType() Import

func (*PasswordType) GetNullableType

func (t *PasswordType) GetNullableType() TSType

type PhoneImport

type PhoneImport struct {
	// contains filtered or unexported fields
}

func (*PhoneImport) Aliases

func (imp *PhoneImport) Aliases() []string

func (*PhoneImport) DefaultImport

func (b *PhoneImport) DefaultImport() bool

func (*PhoneImport) Import

func (imp *PhoneImport) Import() string

func (*PhoneImport) ImportPath

func (imp *PhoneImport) ImportPath() string

type PhoneType

type PhoneType struct {
	StringType
}

func (*PhoneType) GetDBType

func (t *PhoneType) GetDBType() string

func (*PhoneType) GetImportType

func (t *PhoneType) GetImportType() Import

func (*PhoneType) GetNullableType

func (t *PhoneType) GetNullableType() TSType

type RelativeMathInfo added in v0.1.0

type RelativeMathInfo struct {
	Import *tsimport.ImportPath
	Type   string
}

type RelativeMathType added in v0.1.0

type RelativeMathType interface {
	TSType
	GetRelativeMathInfo() *RelativeMathInfo
}

type SchemaType added in v0.1.5

type SchemaType interface {
	IsGlobalEnumWithDisableUnknownType(typ string) bool
}

type StringEnumType added in v0.1.0

type StringEnumType struct {
	EnumDBType         bool
	Type               string
	GraphQLType        string
	Values             []string
	EnumMap            map[string]string
	DisableUnknownType bool

	GlobalType string
	// contains filtered or unexported fields
}

func (*StringEnumType) Convert added in v0.1.0

func (*StringEnumType) GetDBType added in v0.1.0

func (t *StringEnumType) GetDBType() string

func (*StringEnumType) GetEnumData added in v0.1.0

func (t *StringEnumType) GetEnumData() *EnumData

func (*StringEnumType) GetGraphQLType added in v0.1.0

func (t *StringEnumType) GetGraphQLType() string

func (*StringEnumType) GetNullableType added in v0.1.0

func (t *StringEnumType) GetNullableType() TSType

func (*StringEnumType) GetTSGraphQLImports added in v0.1.0

func (t *StringEnumType) GetTSGraphQLImports(input bool) []*tsimport.ImportPath

func (*StringEnumType) GetTSType added in v0.1.0

func (t *StringEnumType) GetTSType() string

func (*StringEnumType) GetTsTypeImports added in v0.1.0

func (t *StringEnumType) GetTsTypeImports() []*tsimport.ImportPath

func (*StringEnumType) SetGraphQLImportPath added in v0.1.0

func (t *StringEnumType) SetGraphQLImportPath(imp *tsimport.ImportPath) *StringEnumType

func (*StringEnumType) SetImportPath added in v0.1.0

func (t *StringEnumType) SetImportPath(imp *tsimport.ImportPath) *StringEnumType

type StringImport

type StringImport struct {
	// contains filtered or unexported fields
}

func (*StringImport) Aliases

func (imp *StringImport) Aliases() []string

func (*StringImport) DefaultImport

func (b *StringImport) DefaultImport() bool

func (*StringImport) Import

func (imp *StringImport) Import() string

func (*StringImport) ImportPath

func (b *StringImport) ImportPath() string

type StringType

type StringType struct {
	// contains filtered or unexported fields
}

func (*StringType) GetDBType

func (t *StringType) GetDBType() string

func (*StringType) GetGraphQLType

func (t *StringType) GetGraphQLType() string

func (*StringType) GetImportType

func (t *StringType) GetImportType() Import

func (*StringType) GetNullableType

func (t *StringType) GetNullableType() TSType

func (*StringType) GetTSGraphQLImports

func (t *StringType) GetTSGraphQLImports(input bool) []*tsimport.ImportPath

func (*StringType) GetTSType

func (t *StringType) GetTSType() string

type TSCodegenableType

type TSCodegenableType interface {
	TSType
	GetImportType() Import
}

type TSType

type TSType interface {
	Type
	GetTSType() string
	// returns imports from outside in
	// e.g. required string => []tsimport.ImportPath{tsimport.NewGQLClassImportPath("GraphQLNonNull"), tsimport.NewGQLImportPath("GraphQLString")}
	GetTSGraphQLImports(input bool) []*tsimport.ImportPath
}

types that also support Typescript

type TSTypeWithActionFields

type TSTypeWithActionFields interface {
	TSTypeWithCustomType
	GetActionFieldsInfo() *ActionFieldsInfo
}

type TSTypeWithCustomType added in v0.1.0

type TSTypeWithCustomType interface {
	TSType
	GetCustomTypeInfo() *CustomTypeInfo
}

type TSTypeWithImports

type TSTypeWithImports interface {
	TSType
	GetTsTypeImports() []*tsimport.ImportPath
}

type TSWithSubFields added in v0.1.0

type TSWithSubFields interface {
	TSTypeWithCustomType
	// this is interface{} so as to avoid circular-dependencies with input.Fields
	GetSubFields() interface{}
}

type TSWithUnionFields added in v0.1.0

type TSWithUnionFields interface {
	TSTypeWithCustomType
	// this is interface{} so as to avoid circular-dependencies with input.Fields
	GetUnionFields() interface{}
}

type TimeImport

type TimeImport struct {
	// contains filtered or unexported fields
}

func (*TimeImport) Aliases

func (imp *TimeImport) Aliases() []string

func (*TimeImport) DefaultImport

func (b *TimeImport) DefaultImport() bool

func (*TimeImport) Import

func (imp *TimeImport) Import() string

func (*TimeImport) ImportPath

func (b *TimeImport) ImportPath() string

type TimeType

type TimeType struct {
	// contains filtered or unexported fields
}

func (*TimeType) GetDBType

func (t *TimeType) GetDBType() string

func (*TimeType) GetGraphQLType

func (t *TimeType) GetGraphQLType() string

func (*TimeType) GetImportType

func (t *TimeType) GetImportType() Import

func (*TimeType) GetNullableType

func (t *TimeType) GetNullableType() TSType

func (*TimeType) GetTSGraphQLImports

func (t *TimeType) GetTSGraphQLImports(input bool) []*tsimport.ImportPath

func (*TimeType) GetTSType

func (t *TimeType) GetTSType() string

type TimestampImport

type TimestampImport struct {
	// contains filtered or unexported fields
}

func (*TimestampImport) Aliases

func (imp *TimestampImport) Aliases() []string

func (*TimestampImport) DefaultImport

func (b *TimestampImport) DefaultImport() bool

func (*TimestampImport) Import

func (imp *TimestampImport) Import() string

func (*TimestampImport) ImportPath

func (b *TimestampImport) ImportPath() string

type TimestampType

type TimestampType struct {
	// contains filtered or unexported fields
}

func (*TimestampType) Convert

func (t *TimestampType) Convert(s SchemaType) ConvertDataTypeRet

func (*TimestampType) GetGraphQLType

func (t *TimestampType) GetGraphQLType() string

use the built in graphql type

func (*TimestampType) GetImportType

func (t *TimestampType) GetImportType() Import

func (*TimestampType) GetNullableType

func (t *TimestampType) GetNullableType() TSType

func (*TimestampType) GetTSGraphQLImports

func (t *TimestampType) GetTSGraphQLImports(input bool) []*tsimport.ImportPath

func (*TimestampType) GetTSType

func (t *TimestampType) GetTSType() string

type TimestamptzImport

type TimestamptzImport struct {
	// contains filtered or unexported fields
}

func (*TimestamptzImport) Aliases

func (imp *TimestamptzImport) Aliases() []string

func (*TimestamptzImport) DefaultImport

func (b *TimestamptzImport) DefaultImport() bool

func (*TimestamptzImport) Import

func (imp *TimestamptzImport) Import() string

func (*TimestamptzImport) ImportPath

func (b *TimestamptzImport) ImportPath() string

type TimestamptzType

type TimestamptzType struct {
	TimestampType
}

func (*TimestamptzType) Convert

func (t *TimestamptzType) Convert(s SchemaType) ConvertDataTypeRet

func (*TimestamptzType) GetDBType

func (t *TimestamptzType) GetDBType() string

func (*TimestamptzType) GetImportType

func (t *TimestamptzType) GetImportType() Import

func (*TimestamptzType) GetNullableType

func (t *TimestamptzType) GetNullableType() TSType

type TimetzImport

type TimetzImport struct {
	// contains filtered or unexported fields
}

func (*TimetzImport) Aliases

func (imp *TimetzImport) Aliases() []string

func (*TimetzImport) DefaultImport

func (b *TimetzImport) DefaultImport() bool

func (*TimetzImport) Import

func (imp *TimetzImport) Import() string

func (*TimetzImport) ImportPath

func (b *TimetzImport) ImportPath() string

type TimetzType

type TimetzType struct {
	TimeType
}

func (*TimetzType) GetDBType

func (t *TimetzType) GetDBType() string

func (*TimetzType) GetImportType

func (t *TimetzType) GetImportType() Import

func (*TimetzType) GetNullableType

func (t *TimetzType) GetNullableType() TSType

type Type

type Type interface {
	GetGraphQLType() string
	GetDBType() string
}

Type represents a Type that's expressed in the framework The only initial requirement is GraphQL/db since that's exposed everywhere

type UUIDImport

type UUIDImport struct {
	// contains filtered or unexported fields
}

func (*UUIDImport) Aliases

func (imp *UUIDImport) Aliases() []string

func (*UUIDImport) DefaultImport

func (b *UUIDImport) DefaultImport() bool

func (*UUIDImport) Import

func (imp *UUIDImport) Import() string

func (*UUIDImport) ImportPath

func (b *UUIDImport) ImportPath() string

Jump to

Keyboard shortcuts

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