Documentation ¶
Index ¶
- Constants
- func FormatTS(cfg *Config) error
- type ChangeType
- type CodegenConfig
- type Config
- func (cfg *Config) AddChangedFile(filePath string)
- func (cfg *Config) AppendPathToModels(paths ...string) string
- func (cfg *Config) Base64EncodeIDs() bool
- func (cfg *Config) ChangeMap() change.ChangeMap
- func (cfg *Config) Clone() *Config
- func (cfg *Config) DatabaseToCompareTo() string
- func (cfg *Config) DebugMode() bool
- func (cfg *Config) DefaultGraphQLFieldFormat() codegenapi.GraphQLFieldFormat
- func (cfg *Config) DefaultGraphQLMutationName() codegenapi.GraphQLMutationName
- func (cfg *Config) DisableBase64Encoding() bool
- func (cfg *Config) DisableGraphQLRoot() bool
- func (cfg *Config) FieldPrivacyEvaluated() codegenapi.FieldPrivacyEvaluated
- func (cfg *Config) GenerateNodeQuery() bool
- func (cfg *Config) GenerateRootResolvers() bool
- func (cfg *Config) GeneratedHeader() string
- func (cfg *Config) GetAbsPathToGraphQL() string
- func (cfg *Config) GetAbsPathToModels() string
- func (cfg *Config) GetAbsPathToRoot() string
- func (cfg *Config) GetCustomGraphQLJSONPath() string
- func (cfg *Config) GetDefaultActionPolicy() *PrivacyConfig
- func (cfg *Config) GetDefaultEntPolicy() *PrivacyConfig
- func (cfg *Config) GetImportPackage() *ImportPackage
- func (cfg *Config) GetImportPathToGraphQL() string
- func (cfg *Config) GetImportPathToModels() string
- func (cfg *Config) GetImportPathToRoot() string
- func (cfg *Config) GetPathToBuildFile() string
- func (cfg *Config) GetPathToCustomSchemaFile() string
- func (cfg *Config) GetPathToSchemaFile() string
- func (cfg *Config) GetQuotedImportPathToConfigs() string
- func (cfg *Config) GetQuotedImportPathToModels() string
- func (cfg *Config) GetRelativePathToConfigs() string
- func (cfg *Config) GetRootPathToConfigs() string
- func (cfg *Config) OverrideGraphQLMutationName(mutationName codegenapi.GraphQLMutationName)
- func (cfg *Config) OverrideImportPathToModels(importPath string)
- func (cfg *Config) SchemaSQLFilePath() string
- func (cfg *Config) SetChangeMap(changes change.ChangeMap)
- func (cfg *Config) SetDebugMode(debugMode bool)
- func (cfg *Config) SetUseChanges(useChanges bool)
- func (cfg *Config) SetWriteAll(writeAll bool)
- func (cfg *Config) ShouldUseRelativePaths() bool
- func (cfg *Config) UseChanges() bool
- func (cfg *Config) WriteAllFiles() bool
- type ConstructOption
- type ImportPackage
- type Option
- type PrettierConfig
- type PrivacyConfig
- type Processor
- func (p *Processor) DisableCustomGraphQL() bool
- func (p *Processor) DisableSchemaGQL() bool
- func (p *Processor) FormatTS() error
- func (p *Processor) FromTest() bool
- func (p *Processor) NoDBChanges() bool
- func (p *Processor) Run(steps []Step, step string, options ...Option) error
- func (p *Processor) WriteSchema() error
- type Step
- type StepWithPostProcess
- type StepWithPreProcess
Constants ¶
View Source
const DEFAULT_GLOB = "src/**/*.ts"
View Source
const PRETTIER_FILE_CHUNKS = 20
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ChangeType ¶
type ChangeType string
const ( // NOTE: this was a list that was in sync with change_type in auto_schema/change_type.py // since deprecated and we're only using one, only keeping reference to that one AddColumn ChangeType = "add_column" )
type CodegenConfig ¶
type CodegenConfig struct { DefaultEntPolicy *PrivacyConfig `yaml:"defaultEntPolicy"` DefaultActionPolicy *PrivacyConfig `yaml:"defaultActionPolicy"` Prettier *PrettierConfig `yaml:"prettier"` RelativeImports bool `yaml:"relativeImports"` DisableGraphQLRoot bool `yaml:"disableGraphQLRoot"` GeneratedHeader string `yaml:"generatedHeader"` DisableBase64Encoding bool `yaml:"disableBase64Encoding"` GenerateRootResolvers bool `yaml:"generateRootResolvers"` DefaultGraphQLMutationName codegenapi.GraphQLMutationName `yaml:"defaultGraphQLMutationName"` DefaultGraphQLFieldFormat codegenapi.GraphQLFieldFormat `yaml:"defaultGraphQLFieldFormat"` SchemaSQLFilePath string `yaml:"schemaSQLFilePath"` DatabaseToCompareTo string `yaml:"databaseToCompareTo"` FieldPrivacyEvaluated codegenapi.FieldPrivacyEvaluated `yaml:"fieldPrivacyEvaluated"` }
func (*CodegenConfig) Clone ¶ added in v0.0.39
func (cfg *CodegenConfig) Clone() *CodegenConfig
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
Config is codegen info/config which is used to pass things down the line
func NewTestConfig ¶
func NewTestConfig(configPath, modulePath string, codegenCfg *CodegenConfig) (*Config, error)
func (*Config) AddChangedFile ¶ added in v0.0.38
func (*Config) AppendPathToModels ¶
used by golang
func (*Config) Base64EncodeIDs ¶ added in v0.0.30
func (*Config) DatabaseToCompareTo ¶ added in v0.0.39
func (*Config) DefaultGraphQLFieldFormat ¶ added in v0.0.39
func (cfg *Config) DefaultGraphQLFieldFormat() codegenapi.GraphQLFieldFormat
func (*Config) DefaultGraphQLMutationName ¶ added in v0.0.39
func (cfg *Config) DefaultGraphQLMutationName() codegenapi.GraphQLMutationName
func (*Config) DisableBase64Encoding ¶ added in v0.0.30
func (*Config) DisableGraphQLRoot ¶
func (*Config) FieldPrivacyEvaluated ¶ added in v0.1.0
func (cfg *Config) FieldPrivacyEvaluated() codegenapi.FieldPrivacyEvaluated
func (*Config) GenerateNodeQuery ¶ added in v0.0.30
func (*Config) GenerateRootResolvers ¶ added in v0.0.30
func (*Config) GeneratedHeader ¶
func (*Config) GetAbsPathToRoot ¶
func (*Config) GetCustomGraphQLJSONPath ¶ added in v0.0.39
func (*Config) GetDefaultActionPolicy ¶
func (cfg *Config) GetDefaultActionPolicy() *PrivacyConfig
func (*Config) GetDefaultEntPolicy ¶
func (cfg *Config) GetDefaultEntPolicy() *PrivacyConfig
func (*Config) GetImportPackage ¶
func (cfg *Config) GetImportPackage() *ImportPackage
func (*Config) GetImportPathToGraphQL ¶
func (*Config) GetImportPathToModels ¶
func (*Config) GetImportPathToRoot ¶
func (*Config) GetPathToBuildFile ¶ added in v0.0.38
func (*Config) GetPathToCustomSchemaFile ¶ added in v0.0.38
func (*Config) GetPathToSchemaFile ¶ added in v0.0.38
func (*Config) GetQuotedImportPathToConfigs ¶
func (*Config) GetQuotedImportPathToModels ¶
func (*Config) GetRelativePathToConfigs ¶
func (*Config) GetRootPathToConfigs ¶
func (*Config) OverrideGraphQLMutationName ¶ added in v0.0.39
func (cfg *Config) OverrideGraphQLMutationName(mutationName codegenapi.GraphQLMutationName)
func (*Config) OverrideImportPathToModels ¶
func (*Config) SchemaSQLFilePath ¶ added in v0.0.39
func (*Config) SetChangeMap ¶ added in v0.0.38
func (*Config) SetDebugMode ¶
func (*Config) SetUseChanges ¶ added in v0.0.38
func (*Config) SetWriteAll ¶ added in v0.0.38
func (*Config) ShouldUseRelativePaths ¶
func (*Config) UseChanges ¶ added in v0.0.38
In rare scenarios, we can have UseChanges() and WriteAll() be true if ent.yml changed so that we can process deletes also
func (*Config) WriteAllFiles ¶ added in v0.0.38
type ConstructOption ¶ added in v0.0.38
type ConstructOption func(*constructOption)
func BuildInfo ¶ added in v0.0.38
func BuildInfo(bi *build_info.BuildInfo) ConstructOption
func DebugMode ¶ added in v0.0.38
func DebugMode() ConstructOption
func ProcessorConfig ¶ added in v0.0.38
func ProcessorConfig(cfg *Config) ConstructOption
func WriteAll ¶ added in v0.0.38
func WriteAll() ConstructOption
type ImportPackage ¶
type ImportPackage struct { PackagePath string AuthPackagePath string ActionPackagePath string SchemaPackagePath string GraphQLPackagePath string InternalImportPath string ExternalImportPath string }
ImportPackage refers to TypeScript paths of what needs to be generated for imports
type Option ¶
type Option func(*option)
func DisableCustomGraphQL ¶
func DisableCustomGraphQL() Option
func DisableFormat ¶
func DisableFormat() Option
func DisablePrompts ¶
func DisablePrompts() Option
func DisableSchemaGQL ¶
func DisableSchemaGQL() Option
type PrettierConfig ¶
func (*PrettierConfig) Clone ¶ added in v0.0.39
func (cfg *PrettierConfig) Clone() *PrettierConfig
type PrivacyConfig ¶
type PrivacyConfig struct { Path string `yaml:"path"` PolicyName string `yaml:"policyName"` Class bool `yaml:"class"` }
func (*PrivacyConfig) Clone ¶ added in v0.0.39
func (cfg *PrivacyConfig) Clone() *PrivacyConfig
type Processor ¶
type Processor struct { Schema *schema.Schema ChangeMap change.ChangeMap Config *Config // contains filtered or unexported fields }
Processor stores the parsed data needed for codegen
func NewCodegenProcessor ¶
func NewTestCodegenProcessor ¶
func (*Processor) DisableCustomGraphQL ¶
func (*Processor) DisableSchemaGQL ¶
func (*Processor) NoDBChanges ¶
func (*Processor) WriteSchema ¶ added in v0.0.38
type StepWithPostProcess ¶ added in v0.0.38
TODO figure out long term thing here
type StepWithPreProcess ¶
Click to show internal directories.
Click to hide internal directories.