mirror of
https://github.com/ent/ent.git
synced 2026-04-28 21:50:56 +03:00
doc/graphql: change mutation-input example to extension
This commit is contained in:
committed by
Ariel Mashraki
parent
ac9f801259
commit
095ef5b4e6
@@ -81,13 +81,17 @@ The full documentation for the template API (Go types and functions) is availabl
|
||||
|
||||
Now, we tell the Ent code generator to execute this template by passing it as an argument in the `ent/entc.go` file:
|
||||
|
||||
```diff
|
||||
```go {8}
|
||||
func main() {
|
||||
err := entc.Generate("./schema", &gen.Config{
|
||||
Templates: entgql.AllTemplates,
|
||||
- })
|
||||
+ }, entc.TemplateDir("./template"))
|
||||
ex, err := entgql.NewExtension()
|
||||
if err != nil {
|
||||
log.Fatalf("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("running ent codegen: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user