codegenapi

package
v0.1.0-alpha.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 5, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultGraphQLMutationName = NounVerb

Variables

This section is empty.

Functions

func GraphQLName

func GraphQLName(cfg Config, name string) string

Types

type Config

type Config interface {
	DefaultGraphQLMutationName() GraphQLMutationName
	DefaultGraphQLFieldFormat() GraphQLFieldFormat
	FieldPrivacyEvaluated() FieldPrivacyEvaluated
	GetRootPathToConfigs() string
	DebugMode() bool
	// doesn't actually writes the files, just keeps track of which files were going to be written
	// used to detect dangling files...
	DummyWrite() bool
	GetTemplatizedViewer() *ViewerConfig
}

this file exists to simplify circular dependencies

type DummyConfig

type DummyConfig struct {
}

DummyConfig exists for tests/legacy paths which need Configs and don't want to create the production one

func (*DummyConfig) DebugMode

func (cfg *DummyConfig) DebugMode() bool

func (*DummyConfig) DefaultGraphQLFieldFormat

func (cfg *DummyConfig) DefaultGraphQLFieldFormat() GraphQLFieldFormat

func (*DummyConfig) DefaultGraphQLMutationName

func (cfg *DummyConfig) DefaultGraphQLMutationName() GraphQLMutationName

func (DummyConfig) DummyWrite added in v0.1.0

func (cfg DummyConfig) DummyWrite() bool

func (DummyConfig) FieldPrivacyEvaluated added in v0.1.0

func (cfg DummyConfig) FieldPrivacyEvaluated() FieldPrivacyEvaluated

func (*DummyConfig) GetRootPathToConfigs

func (cfg *DummyConfig) GetRootPathToConfigs() string

func (DummyConfig) GetTemplatizedViewer added in v0.1.0

func (cfg DummyConfig) GetTemplatizedViewer() *ViewerConfig

type FieldPrivacyEvaluated added in v0.1.0

type FieldPrivacyEvaluated string
const (
	AtEntLoad FieldPrivacyEvaluated = "at_ent_load"
	OnDemand  FieldPrivacyEvaluated = "on_demand"
)

type GraphQLFieldFormat

type GraphQLFieldFormat string
const (
	LowerCamelCase GraphQLFieldFormat = "lowerCamel"

	SnakeCase GraphQLFieldFormat = "snake_case"
)

type GraphQLMutationName

type GraphQLMutationName string
const (
	// e.g. userCreate. default
	NounVerb GraphQLMutationName = "NounVerb"

	// e.g. createUser
	VerbNoun GraphQLMutationName = "VerbNoun"
)

type ViewerConfig

type ViewerConfig struct {
	Path  string `yaml:"path"`
	Name  string `yaml:"name"`
	Alias string `yaml:"alias"`
}

func (*ViewerConfig) Clone

func (cfg *ViewerConfig) Clone() *ViewerConfig

func (*ViewerConfig) GetImport

func (cfg *ViewerConfig) GetImport() string

func (*ViewerConfig) GetImportPath

func (cfg *ViewerConfig) GetImportPath() *tsimport.ImportPath

Jump to

Keyboard shortcuts

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