From 2a943eed912ab9557d124ea1ab7abfc9dd9fa8e8 Mon Sep 17 00:00:00 2001 From: LianYue Date: Sun, 20 Oct 2019 16:00:10 +0800 Subject: [PATCH] Update directive.go fix #860 directive arg name keyword is not converted --- codegen/directive.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codegen/directive.go b/codegen/directive.go index 491f92f43a..f3a3c26208 100644 --- a/codegen/directive.go +++ b/codegen/directive.go @@ -167,7 +167,7 @@ func (d *Directive) Declaration() string { res := ucFirst(d.Name) + " func(ctx context.Context, obj interface{}, next graphql.Resolver" for _, arg := range d.Args { - res += fmt.Sprintf(", %s %s", arg.Name, templates.CurrentImports.LookupType(arg.TypeReference.GO)) + res += fmt.Sprintf(", %s %s", templates.ToGoPrivate(arg.Name), templates.CurrentImports.LookupType(arg.TypeReference.GO)) } res += ") (res interface{}, err error)"