@graphql-hive/render-laboratory
Version:
25 lines (24 loc) • 776 B
JavaScript
export 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,
};
};