diff --git a/src/inferred_mode/inferred_mode.ts b/src/inferred_mode/inferred_mode.ts index a276f6a..9e409d0 100644 --- a/src/inferred_mode/inferred_mode.ts +++ b/src/inferred_mode/inferred_mode.ts @@ -629,6 +629,9 @@ export default class InferredQueryHandler { [resultID: string]: number; } = {}; const auxGraphSuffixes: { [inferredEdgeID: string]: number } = {}; + if (global.queryInformation != null) { + global.queryInformation.totalRecords = {}; + } const completedHandlers = await Promise.all( subQueries.map(async ({ template, queryGraph, qualifiers }, i) => { @@ -640,10 +643,7 @@ export default class InferredQueryHandler { this.predicatePath, this.includeReasoner, ); - if (global.queryInformation != null) { - global.queryInformation.totalRecords = {}; - global.queryInformation.totalRecords[i] = 0; // Ensure 0 starting for each template - } + global.queryInformation.totalRecords[i] = 0; // Ensure 0 starting for each template handler.setQueryGraph(queryGraph); const failedHandlerLogs: { [index: number]: StampedLog[] } = {}; try {