Skip to content

Commit a174579

Browse files
fix: prefetch query counter
1 parent c1e0569 commit a174579

File tree

2 files changed

+289
-2
lines changed

2 files changed

+289
-2
lines changed

pnpm-lock.yaml

Lines changed: 280 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/module.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,15 @@ ${(await readFile(resolve('runtime/types.d.ts'), 'utf-8'))
191191
}
192192
}
193193

194-
// Get length of options.prefetch object
195-
logger.info(`Prefetched ${Object.keys(prefetchResults).length} KQL queries in ${Date.now() - start}ms`)
194+
const prefetchCount = Object.keys(options.prefetch).length
195+
if (prefetchCount > 0) {
196+
const firstQueryResult = Object.keys(options.prefetch)[0]
197+
logger.info(
198+
`Prefetched ${prefetchCount === 1 ? firstQueryResult : prefetchCount} KQL ${
199+
prefetchCount === 1 ? 'query' : 'queries'
200+
} in ${Date.now() - start}ms`,
201+
)
202+
}
196203
}
197204

198205
// Add template for prefetched query data

0 commit comments

Comments
 (0)