Skip to content

Commit 4928da9

Browse files
authored
entgql/templates: ability to add extra fields and methods to mutation inputs (#608)
* ability to add additonal fields to mutation input * Update mutation_input.tmpl removed the model keyword
1 parent 71f9852 commit 4928da9

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

entgql/template/mutation_input.tmpl

+12
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,12 @@ import (
5555
{{- end }}
5656
{{- end }}
5757
{{- end }}
58+
59+
{{- with $tmpls := matchTemplate "helper/gql_mutation_input/fields/*" }}
60+
{{- range $tmpl := $tmpls }}
61+
{{- xtemplate $tmpl $n }}
62+
{{- end }}
63+
{{- end }}
5864
}
5965

6066
// Mutate applies the {{ $input }} on the {{ $n.MutationName }} builder.
@@ -110,6 +116,12 @@ import (
110116
{{- end }}
111117
{{- end }}
112118
{{- end }}
119+
120+
{{- with $tmpls := matchTemplate "helper/gql_mutation_input/mutate/*" }}
121+
{{- range $tmpl := $tmpls }}
122+
{{- xtemplate $tmpl $n }}
123+
{{- end }}
124+
{{- end }}
113125
}
114126

115127
{{- range $b := $n.Builders }}

0 commit comments

Comments
 (0)