modelUtils

package
v1.3.18 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddCustomMutations added in v1.1.1

func AddCustomMutations(
	modelName, dirName string,
	fields, fieldTypes []string,
	nullFields []bool,
	customMutation bool,
) error

AddCustomMutations for creating custom mutation files.

func AddField added in v1.1.1

func AddField(
	modelName string,
	fields, fieldTypes []string,
	nullFields []bool,
) ([]string, []string, []bool)

AddField for adding extra fields.

func CreateCustomResolverFiles

func CreateCustomResolverFiles(modelName, dirName string, resolverFiles, resolverTestFiles []string) error

CreateCustomResolverFiles will create GraphQl model custom resolver files.

func CreateGqlModelFiles

func CreateGqlModelFiles(modelName, dirName string, files, testFiles []string) error

CreateGqlModelFiles will create GraphQl model files.

func CreateNewModel

func CreateNewModel() error

CreateNewModel represent all the CLI questions.

func FieldUtils

func FieldUtils(modelName string, fields, fieldTypes []string, nullFields []bool, customMutation bool) map[string]interface{}

FieldUtils will give all details of models.

func PromptGetInput

func PromptGetInput(pc PromptContent) string

PromptGetInput is the promptui function for taking action according to CLI questions.

func PromptGetSelect

func PromptGetSelect(pc PromptContent) string

PromptGetSelect is the promptui function for taking action according to dropdown CLI questions.

func PromptGetSelectPath

func PromptGetSelectPath(pc PromptContent) string

PromptGetSelect is the promptui function for taking action of selecting the path according to CLI questions.

func PromptGetYesOrNoInput

func PromptGetYesOrNoInput(pc PromptContent) bool

PromptGetYesOrNOInput is the promptui function for taking action according to Yes or No CLI questions.

func PromptValidate added in v1.1.1

func PromptValidate(input string) error

PromptValidate is the validation function.

func WriteCustomResolvers

func WriteCustomResolvers(
	modelName, dirName string,
	fields, fieldTypes, resolverFiles []string,
	nullFields []bool,
	customMutation bool) error

WriteCustomResolvers is the function for write data into custom resolver files.

func WriteMockData

func WriteMockData(modelName, dirName string, fields, fieldTypes []string, nullFields []bool, customMutation bool) error

WriteMockData is the function for write data into mock data files.

func WriteModelFiles

func WriteModelFiles(modelName, dirName string, fields, fieldTypes, files []string, nullFields []bool, customMutation bool) error

WriteModelFiles is the function for write data into model files.

func WriteModelTestFiles

func WriteModelTestFiles(
	modelName, dirName string,
	fields, fieldTypes, testFiles []string,
	nullFields []bool,
	customMutation bool) error

WriteModelTestFiles is the function for write data into model test files.

func WriteTestCustomResolvers

func WriteTestCustomResolvers(
	modelName, dirName string,
	fields, fieldTypes, resolverTestFiles []string,
	nullFields []bool,
	customMutation bool) error

WriteTestCustomResolvers is the function for write data into custom resolver test files.

Types

type PromptContent

type PromptContent struct {
	ErrorMsg string
	Label    string
}

PromptContent is the type of Prompt.

Jump to

Keyboard shortcuts

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