Skip to content

Commit

Permalink
simplify planner config creation
Browse files Browse the repository at this point in the history
  • Loading branch information
devsergiy committed Sep 27, 2023
1 parent 906ea6a commit 31458d0
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions v2/pkg/engine/plan/configuration_visitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 31458d0

Please sign in to comment.