From d7368f175ccd5564147aef5f33b03c92b6a5938f Mon Sep 17 00:00:00 2001 From: Sven Slootweg Date: Tue, 26 Dec 2023 13:22:05 +0100 Subject: [PATCH] Give module context initialization access to the global context --- load-modules.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/load-modules.js b/load-modules.js index 8184cbf..aed8cbc 100644 --- a/load-modules.js +++ b/load-modules.js @@ -147,7 +147,8 @@ module.exports = function (modules) { if (!cache.has(moduleID)) { cache.set(moduleID, { ... baseContext, - ... contextFactories.get(moduleID)() + // NOTE: Module context initialization gets access to the baseContext, for user-level overrides (eg. passing in transaction objects for a query) + ... contextFactories.get(moduleID)(baseContext) }); }