diff --git a/entgql/template/collection.tmpl b/entgql/template/collection.tmpl index a6e7cc440..2c1075a73 100644 --- a/entgql/template/collection.tmpl +++ b/entgql/template/collection.tmpl @@ -28,11 +28,11 @@ import ( {{ $query := $node.QueryName }} // CollectFields tells the query-builder to eagerly load connected nodes by resolver context. func ({{ $receiver }} *{{ $query }}) CollectFields(ctx context.Context, satisfies ...string) (*{{ $query }}, error) { - fc := graphql.GetFieldContext(ctx) - if fc == nil { + fieldContext := graphql.GetFieldContext(ctx) + if fieldContext == nil { return {{ $receiver }}, nil } - if err := {{ $receiver }}.collectField(ctx, graphql.GetOperationContext(ctx), fc.Field, nil, satisfies...); err != nil { + if err := {{ $receiver }}.collectField(ctx, graphql.GetOperationContext(ctx), fieldContext.Field, nil, satisfies...); err != nil { return nil, err } return {{ $receiver }}, nil