UNPKG

grafast

Version:

Cutting edge GraphQL planning and execution engine

41 lines 1.1 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.setDebug = setDebug; exports.getDebug = getDebug; exports.operationPlan = operationPlan; exports.context = context; exports.rootValue = rootValue; exports.variableValues = variableValues; exports.debugPlans = debugPlans; const withGlobalLayerPlan_ts_1 = require("./engine/lib/withGlobalLayerPlan.js"); let debug = false; function setDebug(newDebug) { debug = newDebug; } function getDebug() { return debug; } function operationPlan() { return (0, withGlobalLayerPlan_ts_1.currentLayerPlan)().operationPlan; } function context() { return operationPlan().contextStep; } function rootValue() { return operationPlan().rootValueStep; } function variableValues() { return operationPlan().variableValuesStep; } /** * 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