UNPKG

@graphql-mesh/http

Version:
14 lines (13 loc) 624 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.resolvePlaygroundConfig = resolvePlaygroundConfig; const cross_helpers_1 = require("@graphql-mesh/cross-helpers"); function resolvePlaygroundConfig(playground, defaultEnabled = cross_helpers_1.process.env.NODE_ENV !== 'production') { if (typeof playground === 'boolean') { return { enabled: playground, offline: false }; } if (playground != null && typeof playground === 'object') { return { enabled: true, offline: playground.offline === true }; } return { enabled: defaultEnabled, offline: false }; }