@graphql-hive/render-laboratory
Version:
29 lines (28 loc) • 983 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.mapGraphiQLOptionsToLaboratoryProps = void 0;
const mapGraphiQLOptionsToLaboratoryProps = (opts) => {
var _a, _b;
if (!opts) {
return { enableDocs: true };
}
return {
enableDocs: true,
defaultSettings: {
fetch: {
credentials: (_a = opts.credentials) !== null && _a !== void 0 ? _a : 'same-origin',
timeout: opts.timeout,
useGETForQueries: opts.useGETForQueries,
},
subscriptions: {
protocol: (_b = opts.subscriptionsProtocol) !== null && _b !== void 0 ? _b : 'WS',
},
introspection: {
method: opts.method,
},
},
defaultCollections: opts.defaultCollections,
defaultEndpoint: opts.endpoint,
};
};
exports.mapGraphiQLOptionsToLaboratoryProps = mapGraphiQLOptionsToLaboratoryProps;