Skip to content

Instantly share code, notes, and snippets.

@manakuro
Created December 10, 2021 04:38
Show Gist options
  • Select an option

  • Save manakuro/e1e52d3b605756d5b6bf5653900f6853 to your computer and use it in GitHub Desktop.

Select an option

Save manakuro/e1e52d3b605756d5b6bf5653900f6853 to your computer and use it in GitHub Desktop.
//go:build ignore
// +build ignore
package main
import (
"log"
"entgo.io/contrib/entgql"
"entgo.io/ent/entc"
"entgo.io/ent/entc/gen"
)
func main() {
ex, err := entgql.NewExtension()
if err != nil {
log.Fatalf("Error: failed creating entgql extension: %v", err)
}
opts := []entc.Option{
entc.Extensions(ex),
entc.TemplateDir("./template"),
}
if err := entc.Generate("./schema", &gen.Config{}, opts...); err != nil {
log.Fatalf("Error: failed running ent codegen: %v", err)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment