Skip to content

Instantly share code, notes, and snippets.

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

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

Select an option

Save manakuro/05a89db9dc72b64d8253c8fa25fffad5 to your computer and use it in GitHub Desktop.
//go:build ignore
// +build ignore
package main
import (
"errors"
"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)
}
if err := entc.Generate("./schema", &gen.Config{}, entc.Extensions(ex)); 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