Documentation ¶
Index ¶
- Variables
- func SchemaGet(config SchemaConfig) string
- func SchemaWrite(config SchemaConfig, outputFile string, generateOptions SchemaGenerateConfig) error
- type AuthorizationScope
- type ConvertPlugin
- type ConvertPluginConfig
- type ConvertTemplateData
- type DatabaseDriver
- type File
- type Import
- type ModelPlugin
- type ParentType
- 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 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 ConvertPlugin ¶
type ConvertPlugin struct { BoilerCache *cache.BoilerCache ModelCache *cache.ModelCache PluginConfig ConvertPluginConfig // contains filtered or unexported fields }
func NewConvertPlugin ¶
func NewConvertPlugin(modelCache *cache.ModelCache, pluginConfig ConvertPluginConfig) *ConvertPlugin
func (*ConvertPlugin) GenerateCode ¶ added in v3.3.10
func (m *ConvertPlugin) GenerateCode() error
type ConvertPluginConfig ¶
type ConvertPluginConfig struct {
DatabaseDriver DatabaseDriver
}
type ConvertTemplateData ¶ added in v3.3.10
type ConvertTemplateData struct { Backend structs.Config Frontend structs.Config PluginConfig ConvertPluginConfig PackageName string Interfaces []*structs.Interface Models []*structs.Model Enums []*structs.Enum Scalars []string }
func (ConvertTemplateData) Imports ¶ added in v3.3.10
func (t ConvertTemplateData) Imports() []Import
type DatabaseDriver ¶ added in v3.2.4
type DatabaseDriver string
DatabaseDriver defines which data syntax to use for some of the converts
const ( // MySQL is the default MySQL DatabaseDriver = "mysql" // PostgreSQL is the default PostgreSQL DatabaseDriver = "postgres" )
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 ModelPlugin ¶ added in v3.3.10
type ModelPlugin struct { }
func NewModelPlugin ¶ added in v3.3.10
func NewModelPlugin() *ModelPlugin
func (*ModelPlugin) GenerateCode ¶ added in v3.3.10
type ParentType ¶ added in v3.1.5
type ParentType string
const ( ParentTypeNormal ParentType = "Normal" ParentTypeWhere ParentType = "Where" ParentTypeCreate ParentType = "Create" ParentTypeUpdate ParentType = "Update" ParentTypeBatchUpdate ParentType = "BatchUpdate" ParentTypeBatchCreate ParentType = "BatchCreate" )
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 structs.Model InputModel structs.Model BoilerWhiteList string PublicErrorKey string PublicErrorMessage string SoftDeleteSuffix string }
type ResolverBuild ¶
type ResolverBuild struct { *File HasRoot bool PackageName string ResolverType string Models []*structs.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 { BoilerCache *cache.BoilerCache ModelCache *cache.ModelCache // contains filtered or unexported fields }
func NewResolverPlugin ¶
func NewResolverPlugin(resolverConfig config.ResolverConfig, output structs.Config, boilerCache *cache.BoilerCache, modelCache *cache.ModelCache, resolverPluginConfig ResolverPluginConfig) *ResolverPlugin
func (*ResolverPlugin) GenerateCode ¶
func (m *ResolverPlugin) GenerateCode(data *codegen.Data) error
type ResolverPluginConfig ¶ added in v3.1.0
type ResolverPluginConfig struct { EnableSoftDeletes bool AuthorizationScopes []*AuthorizationScope }
type SchemaConfig ¶
type SchemaConfig struct { BoilerCache *cache.BoilerCache Directives []string SkipInputFields []string GenerateBatchCreate bool GenerateMutations bool GenerateBatchDelete bool GenerateBatchUpdate bool HookShouldAddModel func(model SchemaModel) bool HookShouldAddField func(model SchemaModel, field SchemaField) bool HookChangeField func(model *SchemaModel, field *SchemaField) HookChangeFields func(model *SchemaModel, fields []*SchemaField, parenType ParentType) []*SchemaField HookChangeModel func(model *SchemaModel) }
type SchemaField ¶
type SchemaField struct { Name string Type string // String, ID, Integer InputWhereType string InputCreateType string InputUpdateType string InputBatchUpdateType string InputBatchCreateType string BoilerField *structs.BoilerField SkipInput bool SkipWhere bool SkipCreate bool SkipUpdate bool SkipBatchUpdate bool SkipBatchCreate bool InputDirectives []string Directives []string }
func NewSchemaField ¶ added in v3.1.5
func NewSchemaField(name string, typ string, boilerField *structs.BoilerField) *SchemaField
func (*SchemaField) SetInputTypeForAllInputs ¶ added in v3.1.5
func (s *SchemaField) SetInputTypeForAllInputs(v string)
func (*SchemaField) SetSkipForAllInputs ¶ added in v3.1.5
func (s *SchemaField) SetSkipForAllInputs(v bool)
type SchemaGenerateConfig ¶
type SchemaGenerateConfig struct {
MergeSchema bool
}
type SchemaModel ¶
type SchemaModel struct { Name string IsView bool Fields []*SchemaField }
type SimpleWriter ¶
type SimpleWriter struct {
// contains filtered or unexported fields
}
Source Files ¶
Click to show internal directories.
Click to hide internal directories.