entity icon indicating copy to clipboard operation
entity copied to clipboard

Add a way to record isolated operations

Open wschurman opened this issue 5 years ago • 1 comments

While debugging, it would be useful to be able to get information about entity loads/mutations/etc to see things like:

  • If it hit the DB, what was the query run
  • If it hit or wrote to the cache, what were the cache keys used
  • If it only went to the dataloader, indicate as such
  • etc...

An API for this could look something like:

const [queryContextAuditResult, entityResultFromInnerBlock] = await withIsolatedQueryContext(async (queryContext) => {
  return await BlahEntity.loader(viewerContext, queryContext).load(...);
});
console.log(queryContextAuditResult);

wschurman avatar Jun 18 '20 21:06 wschurman

Expanding upon this further, would be nice to have general debug mode, kinda like knex's debug maybe: https://knexjs.org/faq/#how-do-i-debug

wschurman avatar Jun 05 '25 18:06 wschurman