Created
December 10, 2021 04:38
-
-
Save manakuro/e1e52d3b605756d5b6bf5653900f6853 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //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