Skip to content

Commit 2d81d47

Browse files
authored
entgql/template: improve goimports time by adding missing imports (ent#584)
1 parent d262910 commit 2d81d47

File tree

4 files changed

+6
-0
lines changed

4 files changed

+6
-0
lines changed

entgql/template/collection.tmpl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ in the LICENSE file in the root directory of this source tree.
1414
{{ $gqlNodes := filterNodes $.Nodes (skipMode "type") }}
1515

1616
import (
17+
"entgo.io/contrib/entgql"
1718
"github.com/99designs/gqlgen/graphql"
1819
{{- range $n := $gqlNodes }}
1920
"{{ $.Config.Package }}/{{ $n.Package }}"

entgql/template/edge.tmpl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,12 @@ in the LICENSE file in the root directory of this source tree.
99
{{ define "gql_edge" }}
1010
{{ template "header" $ }}
1111

12+
{{ template "import" $ }}
13+
1214
import (
1315
"context"
1416

17+
"entgo.io/contrib/entgql"
1518
"github.com/99designs/gqlgen/graphql"
1619
)
1720

entgql/template/mutation_input.tmpl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
{{ $gqlNodes := filterNodes $.Nodes (skipMode "mutation_create_input" "mutation_update_input") }}
1313
import (
14+
"entgo.io/contrib/entgql"
1415
{{- range $n := $gqlNodes }}
1516
{{- template "import/types" $n }}
1617
"{{ $.Config.Package }}/{{ $n.Package }}"

entgql/template/pagination.tmpl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import (
3030
{{- range $n := $gqlNodes }}
3131
"{{ $.Config.Package }}/{{ $n.Package }}"
3232
{{- end }}
33+
"{{ $.Config.Package }}/predicate"
3334

3435
"entgo.io/ent/dialect/sql"
3536
"entgo.io/contrib/entgql"

0 commit comments

Comments
 (0)