Skip to content

Commit

Permalink
entgql/template: improve goimports time by adding missing imports (en…
Browse files Browse the repository at this point in the history
  • Loading branch information
a8m authored Jun 17, 2024
1 parent d262910 commit 2d81d47
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions entgql/template/collection.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ in the LICENSE file in the root directory of this source tree.
{{ $gqlNodes := filterNodes $.Nodes (skipMode "type") }}

import (
"entgo.io/contrib/entgql"
"github.com/99designs/gqlgen/graphql"
{{- range $n := $gqlNodes }}
"{{ $.Config.Package }}/{{ $n.Package }}"
Expand Down
3 changes: 3 additions & 0 deletions entgql/template/edge.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,12 @@ in the LICENSE file in the root directory of this source tree.
{{ define "gql_edge" }}
{{ template "header" $ }}

{{ template "import" $ }}

import (
"context"

"entgo.io/contrib/entgql"
"github.com/99designs/gqlgen/graphql"
)

Expand Down
1 change: 1 addition & 0 deletions entgql/template/mutation_input.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

{{ $gqlNodes := filterNodes $.Nodes (skipMode "mutation_create_input" "mutation_update_input") }}
import (
"entgo.io/contrib/entgql"
{{- range $n := $gqlNodes }}
{{- template "import/types" $n }}
"{{ $.Config.Package }}/{{ $n.Package }}"
Expand Down
1 change: 1 addition & 0 deletions entgql/template/pagination.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import (
{{- range $n := $gqlNodes }}
"{{ $.Config.Package }}/{{ $n.Package }}"
{{- end }}
"{{ $.Config.Package }}/predicate"

"entgo.io/ent/dialect/sql"
"entgo.io/contrib/entgql"
Expand Down

0 comments on commit 2d81d47

Please sign in to comment.