gqlgen

package
v0.0.0-...-16a7155 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CmdGqlgen = &cobra.Command{
	Use: "gqlgen",

	Short: "Init a GraphQL components",
	Long:  `Init a GraphQL components`,

	RunE: func(cmd *cobra.Command, args []string) error {
		ctx := context.Background()

		initor, err := gen.NewInitor(gqlgen.Config{
			GqlgenDescPath: flagGqlgenConfigPath,
		})
		if err != nil {
			return fmt.Errorf("boiler: failed to create initor: %w", err)
		}
		if err = initor.Init(ctx); err != nil {
			return fmt.Errorf("boiler: initor failed: %w", err)
		}
		log.Infof("boiler: gqlgen components initialized")

		return nil
	},

	PreRunE: func(cmd *cobra.Command, args []string) error {
		ctx := context.Background()

		initor, err := gen.NewInitor(project.Config{
			GoModName:       flagGoModName,
			GoModVersion:    flagGoModVersion,
			ProjectDescPath: flagProjectConfigPath,
		})
		if err != nil {
			return fmt.Errorf("boiler: failed to create initor: %w", err)
		}
		if err = initor.Init(ctx); err != nil {
			return fmt.Errorf("boiler: initor failed: %w", err)
		}
		log.Infof("boiler: project components initialized")

		return nil
	},

	PostRunE: func(cmd *cobra.Command, args []string) error {
		return execMakeGqlgenBinDeps()
	},
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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