diff --git a/codegen/generated!.gotpl b/codegen/generated!.gotpl index e173bfe3c47..a51f295d54f 100644 --- a/codegen/generated!.gotpl +++ b/codegen/generated!.gotpl @@ -39,7 +39,7 @@ type ResolverRoot interface { type DirectiveRoot struct { {{ range $directive := .Directives }} - {{ $directive.Declaration }} + {{- $directive.Declaration }} {{ end }} } diff --git a/codegen/testserver/generated.go b/codegen/testserver/generated.go index 31e0031785e..99b4c328ec8 100644 --- a/codegen/testserver/generated.go +++ b/codegen/testserver/generated.go @@ -52,24 +52,15 @@ type ResolverRoot interface { } type DirectiveRoot struct { - Custom func(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error) - - Directive1 func(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error) - - Directive2 func(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error) - - Length func(ctx context.Context, obj interface{}, next graphql.Resolver, min int, max *int, message *string) (res interface{}, err error) - - Logged func(ctx context.Context, obj interface{}, next graphql.Resolver, id string) (res interface{}, err error) - - MakeNil func(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error) - - MakeTypedNil func(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error) - - Range func(ctx context.Context, obj interface{}, next graphql.Resolver, min *int, max *int) (res interface{}, err error) - - ToNull func(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error) - + Custom func(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error) + Directive1 func(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error) + Directive2 func(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error) + Length func(ctx context.Context, obj interface{}, next graphql.Resolver, min int, max *int, message *string) (res interface{}, err error) + Logged func(ctx context.Context, obj interface{}, next graphql.Resolver, id string) (res interface{}, err error) + MakeNil func(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error) + MakeTypedNil func(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error) + Range func(ctx context.Context, obj interface{}, next graphql.Resolver, min *int, max *int) (res interface{}, err error) + ToNull func(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error) Unimplemented func(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error) } diff --git a/example/todo/generated.go b/example/todo/generated.go index fe76f771460..6e50484720e 100644 --- a/example/todo/generated.go +++ b/example/todo/generated.go @@ -41,8 +41,7 @@ type ResolverRoot interface { type DirectiveRoot struct { HasRole func(ctx context.Context, obj interface{}, next graphql.Resolver, role Role) (res interface{}, err error) - - User func(ctx context.Context, obj interface{}, next graphql.Resolver, id int) (res interface{}, err error) + User func(ctx context.Context, obj interface{}, next graphql.Resolver, id int) (res interface{}, err error) } type ComplexityRoot struct { diff --git a/example/type-system-extension/generated.go b/example/type-system-extension/generated.go index 2a1f31f8681..dc4a99bfe21 100644 --- a/example/type-system-extension/generated.go +++ b/example/type-system-extension/generated.go @@ -40,19 +40,13 @@ type ResolverRoot interface { } type DirectiveRoot struct { - EnumLogging func(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error) - - FieldLogging func(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error) - - InputLogging func(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error) - + EnumLogging func(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error) + FieldLogging func(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error) + InputLogging func(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error) InterfaceLogging func(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error) - - ObjectLogging func(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error) - - ScalarLogging func(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error) - - UnionLogging func(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error) + ObjectLogging func(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error) + ScalarLogging func(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error) + UnionLogging func(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error) } type ComplexityRoot struct {