Documentation
¶
Index ¶
- Variables
- func HasStringPrimaryIDsInModels(models []*Model) bool
- func NameForDir(dir string) string
- func NewConvertPlugin(directory, backendModelsPath, frontendModelsPath string) plugin.Plugin
- func NewResolverPlugin(convertHelpersDir, backendModelsPath, frontendModelsPath string, ...) plugin.Plugin
- func PkgAndType(name string) (string, string)
- func SanitizePackageName(pkg string) string
- type BoilerField
- type BoilerModel
- type BoilerType
- type ColumnSetting
- type ConvertConfig
- type ConvertPlugin
- type Enum
- type EnumValue
- type Field
- type File
- type Import
- type Interface
- type Model
- type ModelBuild
- type Resolver
- type ResolverBuild
- type ResolverPlugin
- type Rewriter
Constants ¶
This section is empty.
Variables ¶
View Source
var InputTypes = []string{"Create", "Update", "Delete"}
Functions ¶
func HasStringPrimaryIDsInModels ¶ added in v2.0.7
func NameForDir ¶
NameForDir manually looks for package stanzas in files located in the given directory. This can be much faster than having to consult go list, because we already know exactly where to look.
func NewConvertPlugin ¶
func NewResolverPlugin ¶
func PkgAndType ¶
take a string in the form github.com/package/blah.Type and split it into package and type
func SanitizePackageName ¶
Types ¶
type BoilerField ¶
type BoilerModel ¶
type BoilerModel struct { Name string PluralName string Fields []*BoilerField HasOrganizationID bool HasUserOrganizationID bool HasUserID bool }
func FindBoilerModel ¶
func FindBoilerModel(models []*BoilerModel, modelName string) BoilerModel
func GetBoilerModels ¶
func GetBoilerModels(dir string) []*BoilerModel
parseModelsAndFieldsFromBoiler since these are like User.ID, User.Organization and we want them grouped by modelName and their belonging fields.
type BoilerType ¶
type ColumnSetting ¶
type ConvertConfig ¶
type ConvertPlugin ¶
type ConvertPlugin struct {
// contains filtered or unexported fields
}
func (*ConvertPlugin) MutateConfig ¶
func (m *ConvertPlugin) MutateConfig(originalCfg *config.Config) error
func (*ConvertPlugin) Name ¶
func (m *ConvertPlugin) Name() string
type Field ¶
type Field struct { Name string PluralName string Type string IsNumberID bool IsPrimaryNumberID bool IsRequired bool IsPlural bool ConvertConfig ConvertConfig // relation stuff IsRelation bool // boiler relation stuff is inside this field BoilerField BoilerField // graphql relation ship can be found here Relationship *Model IsOr bool IsAnd bool // Some stuff Description string OriginalType types.Type Tag string }
type File ¶
type File struct { // These are separated because the type definition of the resolver object may live in a different file from the //resolver method implementations, for example when extending a type in a different graphql schema file Objects []*codegen.Object Resolvers []*Resolver RemainingSource string // contains filtered or unexported fields }
type Model ¶
type Model struct { Name string PluralName string BoilerModel BoilerModel PrimaryKeyType string Fields []*Field IsNormal bool IsInput bool IsCreateInput bool IsUpdateInput bool IsNormalInput bool IsPayload bool IsWhere bool IsFilter bool PreloadMap map[string]ColumnSetting HasOrganizationID bool HasUserOrganizationID bool HasUserID bool HasStringPrimaryID bool // other stuff Description string PureFields []*ast.FieldDefinition Implements []string }
func GetModelsWithInformation ¶
func GetModelsWithInformation(enums []*Enum, cfg *config.Config, boilerModels []*BoilerModel) []*Model
type ModelBuild ¶
type Resolver ¶
type Resolver struct { Object *codegen.Object Field *codegen.Field Implementation string IsSingle bool IsList bool IsCreate bool IsUpdate bool IsDelete bool IsBatchCreate bool IsBatchUpdate bool IsBatchDelete bool BoilerWhiteList string ResolveOrganizationID bool ResolveUserOrganizationID bool ResolveUserID bool Model Model InputModel Model PublicErrorKey string PublicErrorMessage string }
type ResolverBuild ¶
type ResolverPlugin ¶
type ResolverPlugin struct {
// contains filtered or unexported fields
}
func (*ResolverPlugin) GenerateCode ¶
func (m *ResolverPlugin) GenerateCode(data *codegen.Data) error
func (*ResolverPlugin) Name ¶
func (m *ResolverPlugin) Name() string
type Rewriter ¶
type Rewriter struct {
// contains filtered or unexported fields
}
func NewRewriter ¶
func (*Rewriter) ExistingImports ¶
func (*Rewriter) GetMethodBody ¶
func (*Rewriter) MarkStructCopied ¶
func (*Rewriter) RemainingSource ¶
Click to show internal directories.
Click to hide internal directories.