Documentation
¶
Index ¶
- Variables
- func NewConvertPlugin(output, backend, frontend Config, pluginConfig ConvertPluginConfig) plugin.Plugin
- func NewResolverPlugin(output, backend, frontend Config, resolverPluginConfig ResolverPluginConfig) plugin.Plugin
- func SchemaGet(config SchemaConfig) string
- func SchemaWrite(config SchemaConfig, outputFile string, generateOptions SchemaGenerateConfig) error
- type AuthorizationScope
- type BoilerField
- type BoilerModel
- type BoilerType
- type ColumnSetting
- type Config
- type ConvertConfig
- type ConvertPlugin
- type ConvertPluginConfig
- type Enum
- type EnumValue
- type Field
- type File
- type Import
- type Interface
- type Model
- type ModelBuild
- type Preload
- type Resolver
- type ResolverBuild
- type ResolverPlugin
- type ResolverPluginConfig
- type SchemaConfig
- type SchemaField
- type SchemaGenerateConfig
- type SchemaModel
- type SimpleWriter
Constants ¶
This section is empty.
Variables ¶
View Source
var InputTypes = []string{"Create", "Update", "Delete"} //nolint:gochecknoglobals
Functions ¶
func NewConvertPlugin ¶
func NewConvertPlugin(output, backend, frontend Config, pluginConfig ConvertPluginConfig) plugin.Plugin
func NewResolverPlugin ¶
func NewResolverPlugin(output, backend, frontend Config, resolverPluginConfig ResolverPluginConfig) plugin.Plugin
func SchemaGet ¶
func SchemaGet( config SchemaConfig, ) string
func SchemaWrite ¶
func SchemaWrite(config SchemaConfig, outputFile string, generateOptions SchemaGenerateConfig) error
Types ¶
type AuthorizationScope ¶ added in v3.1.0
type BoilerField ¶
type BoilerModel ¶
type BoilerModel struct {
Name string
TableName string
PluralName string
Fields []*BoilerField
HasPrimaryStringID 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 {
Output Config
Backend Config
Frontend Config
PluginConfig ConvertPluginConfig
// 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 ConvertPluginConfig ¶
type ConvertPluginConfig struct {
UseReflectWorkaroundForSubModelFilteringInPostgresIssue25 bool
}
type Field ¶
type Field struct {
Name string
JSONName string
PluralName string
Type string
TypeWithoutPointer string
IsNumberID bool
IsPrimaryNumberID bool
IsPrimaryStringID bool
IsPrimaryID bool
IsRequired bool
IsPlural bool
ConvertConfig ConvertConfig
Enum *Enum
// relation stuff
IsRelation bool
IsObject 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
}
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
Imports []Import
RemainingSource string
}
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
IsConnection bool
IsEdge bool
IsOrdering bool
IsWhere bool
IsFilter bool
IsPreloadable bool
PreloadArray []Preload
HasPrimaryStringID bool
// other stuff
Description string
PureFields []*ast.FieldDefinition
Implements []string
}
type ModelBuild ¶
type Preload ¶
type Preload struct {
Key string
ColumnSetting ColumnSetting
}
type Resolver ¶
type Resolver struct {
Object *codegen.Object
Field *codegen.Field
Implementation string
IsSingle bool
IsList bool
IsListForward bool
IsListBackward bool
IsCreate bool
IsUpdate bool
IsDelete bool
IsBatchCreate bool
IsBatchUpdate bool
IsBatchDelete bool
ResolveOrganizationID bool // TODO: something more pluggable
ResolveUserOrganizationID bool // TODO: something more pluggable
ResolveUserID bool // TODO: something more pluggable
Model Model
InputModel Model
BoilerWhiteList string
PublicErrorKey string
PublicErrorMessage string
}
type ResolverBuild ¶
type ResolverBuild struct {
*File
HasRoot bool
PackageName string
ResolverType string
Models []*Model
AuthorizationScopes []*AuthorizationScope
TryHook func(string) bool
}
func (*ResolverBuild) ShortResolverDeclaration ¶ added in v3.1.0
func (rb *ResolverBuild) ShortResolverDeclaration(r *Resolver) string
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 ResolverPluginConfig ¶ added in v3.1.0
type ResolverPluginConfig struct {
AuthorizationScopes []*AuthorizationScope
}
type SchemaConfig ¶
type SchemaField ¶
type SchemaField struct {
Name string
Type string // String, ID, Integer
RelationName string // posts
RelationType string // Page, User, Post
FullType string // e.g String! or if array [String!]
RelationFullType string // [Posts!]
FullTypeOptional string // e.g. String or if array [String]
BoilerField *BoilerField
}
type SchemaGenerateConfig ¶
type SchemaGenerateConfig struct {
MergeSchema bool
}
type SchemaModel ¶
type SchemaModel struct {
Name string
Fields []*SchemaField
}
type SimpleWriter ¶
type SimpleWriter struct {
// contains filtered or unexported fields
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.
