UNPKG

grafast

Version:

Cutting edge GraphQL planning and execution engine

37 lines 987 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.setDebug = setDebug; exports.getDebug = getDebug; exports.operationPlan = operationPlan; exports.context = context; exports.rootValue = rootValue; exports.debugPlans = debugPlans; const withGlobalLayerPlan_js_1 = require("./engine/lib/withGlobalLayerPlan.js"); let debug = false; function setDebug(newDebug) { debug = newDebug; } function getDebug() { return debug; } function operationPlan() { return (0, withGlobalLayerPlan_js_1.currentLayerPlan)().operationPlan; } function context() { return operationPlan().contextStep; } function rootValue() { return operationPlan().rootValueStep; } /** * Turns on debug mode, calls the callback, and then turns debug mode back off * again. */ function debugPlans(callback) { const oldDebug = getDebug(); setDebug(true); const result = callback(); setDebug(oldDebug); return result; } //# sourceMappingURL=global.js.map