generate

package
v0.10.38 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultGenerateOutputFile = "types.go"
)

Variables

View Source
var Command = &cobra.Command{
	Use:   "generate",
	Short: "Generate code from GraphQL Schema",
	Long: `Generate code from GraphQL Schema

The generate command will generate code based on the
configured types in your .tutone.yml configuration file.
Use the --refetch flag when new types have been added to
your upstream GraphQL schema to ensure your generated code
is up to date with your configured GraphQL API.
`,
	Example: "tutone generate --config .tutone.yml",
	Run: func(cmd *cobra.Command, args []string) {
		util.LogIfError(log.ErrorLevel, Generate(GeneratorOptions{
			PackageName: packageName,
			Refetch:     refetch,
		}))
	},
}

Functions

func Generate

func Generate(options GeneratorOptions) error

Generate reads the configuration file and executes generators relevant to a particular package.

Types

type GeneratorOptions added in v0.2.0

type GeneratorOptions struct {
	PackageName string
	Refetch     bool
}

Jump to

Keyboard shortcuts

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