From 31458d071c8d440aca8344a8005c5782f4049853 Mon Sep 17 00:00:00 2001 From: spetrunin Date: Tue, 26 Sep 2023 23:25:12 +0300 Subject: [PATCH] simplify planner config creation --- v2/pkg/engine/plan/configuration_visitor.go | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/v2/pkg/engine/plan/configuration_visitor.go b/v2/pkg/engine/plan/configuration_visitor.go index 3b35ea20a..b5ee5a805 100644 --- a/v2/pkg/engine/plan/configuration_visitor.go +++ b/v2/pkg/engine/plan/configuration_visitor.go @@ -564,12 +564,6 @@ func (c *configurationVisitor) addNewPlanner(ref int, typeName, fieldName, curre return -1, false } - plannerConfig := &plannerConfiguration{ - dataSourceConfiguration: *config, - requiredFields: make(FederationFieldConfigurations, 0, 4), - providedFields: make(NodeSuggestions, 0, 4), - } - fetchID := c.nextFetchID() planner := config.Factory.Planner(c.ctx) isParentAbstract := c.isParentTypeNodeAbstractType() @@ -635,10 +629,13 @@ func (c *configurationVisitor) addNewPlanner(ref int, typeName, fieldName, curre plannerPath = precedingFragmentPath } - plannerConfig.parentPath = plannerPath - plannerConfig.planner = planner - plannerConfig.paths = paths - plannerConfig.insideArray = c.insideArray(parentPath) + plannerConfig := &plannerConfiguration{ + dataSourceConfiguration: *config, + parentPath: plannerPath, + planner: planner, + paths: paths, + insideArray: c.insideArray(parentPath), + } fieldDefinition, ok := c.walker.FieldDefinition(ref) if !ok {