diff --git a/query-planner-js/src/buildPlan.ts b/query-planner-js/src/buildPlan.ts index e31a81754..46c75de2b 100644 --- a/query-planner-js/src/buildPlan.ts +++ b/query-planner-js/src/buildPlan.ts @@ -610,7 +610,7 @@ class QueryPlanningTraversal { const pruned: ClosedBranch = []; for (const toCheck of branch) { - if (!this.optionIsOverriden(toCheck.paths, branch)) { + if (!this.optionIsOverriden(toCheck.paths, pruned)) { pruned.push(toCheck); } }