@@ -665,7 +665,7 @@ class QueryPlanningTraversal<RV extends Vertex> {
665
665
const maxPlansToCompute = this . parameters . config . debug . maxEvaluatedPlans ;
666
666
while ( planCount > maxPlansToCompute && firstBranch . length > 1 ) {
667
667
// we remove the right-most option of the first branch, and them move that branch to it's new place.
668
- const prevSize = firstBranch . length ;
668
+ const prevSize = BigInt ( firstBranch . length ) ;
669
669
firstBranch . pop ( ) ;
670
670
planCount -= planCount / prevSize ;
671
671
this . reorderFirstBranch ( ) ;
@@ -678,7 +678,7 @@ class QueryPlanningTraversal<RV extends Vertex> {
678
678
// Note that if `!this.isTopLevel`, then this means we're resolving a sub-plan for an edge condition, and we
679
679
// don't want to count those as "evaluated plans".
680
680
if ( this . parameters . statistics && this . isTopLevel ) {
681
- this . parameters . statistics . evaluatedPlanCount += planCount ;
681
+ this . parameters . statistics . evaluatedPlanCount += Number ( planCount ) ;
682
682
}
683
683
684
684
debug . log ( ( ) => `All branches:${ this . closedBranches . map ( ( opts , i ) => `\n${ i } :${ opts . map ( ( opt => `\n - ${ closedPathToString ( opt ) } ` ) ) } ` ) } ` ) ;
@@ -3596,16 +3596,16 @@ function mapOptionsToSelections<RV extends Vertex>(
3596
3596
return selectionSet . selectionsInReverseOrder ( ) . map ( node => [ node , options ] ) ;
3597
3597
}
3598
3598
3599
- function possiblePlans ( closedBranches : ClosedBranch < any > [ ] ) : number {
3600
- let totalCombinations = 1 ;
3599
+ function possiblePlans ( closedBranches : ClosedBranch < any > [ ] ) : bigint {
3600
+ let totalCombinations = BigInt ( 1 ) ;
3601
3601
for ( let i = 0 ; i < closedBranches . length ; ++ i ) {
3602
- const eltSize = closedBranches [ i ] . length ;
3603
- if ( eltSize === 0 ) {
3602
+ const eltSize = BigInt ( closedBranches [ i ] . length ) ;
3603
+ if ( eltSize === BigInt ( 0 ) ) {
3604
3604
// This would correspond to not being to find *any* path for a particular queried field, which means we have no plan
3605
3605
// for the overall query. Now, this shouldn't happen in practice if composition validation has been run successfully
3606
3606
// (and is not buggy), since the goal of composition validation is exactly to ensure we can never run into this path.
3607
3607
// In any case, we will throw later if that happens, but let's just return the proper result here, which is no plan at all.
3608
- return 0 ;
3608
+ return BigInt ( 0 ) ;
3609
3609
}
3610
3610
totalCombinations *= eltSize ;
3611
3611
}
0 commit comments