Files
klz-cables.com/.pnpm-store/v10/files/41/b83943d36a95ec19b06cb7a766a87ba94a80feb76ca6b3cc7270bc666b188ca1e543e8b2e33c302068a64f1aa43298927ae12ce7e53ea9aba686fc801922dc
Marc Mintel 5397309103
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
fix(products): fix breadcrumbs and product filtering (backport from main)
2026-02-24 16:04:21 +01:00

39 lines
1.3 KiB
Plaintext

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createHandler = void 0;
const handler_1 = require("../../handler");
/**
* Create a GraphQL over HTTP spec compliant request handler for netlify functions
*
* @category Server/@netlify/functions
*/
function createHandler(options) {
const handler = (0, handler_1.createHandler)(options);
return async function handleRequest(req, ctx) {
try {
const [body, init] = await handler({
method: req.httpMethod,
url: req.rawUrl,
headers: req.headers,
body: req.body,
raw: req,
context: ctx,
});
return {
// if body is null, return undefined
body: body !== null && body !== void 0 ? body : undefined,
statusCode: init.status,
headers: init.headers,
};
}
catch (err) {
// The handler shouldnt throw errors.
// If you wish to handle them differently, consider implementing your own request handler.
console.error('Internal error occurred during request handling. ' +
'Please check your implementation.', err);
return { statusCode: 500 };
}
};
}
exports.createHandler = createHandler;