Files
klz-cables.com/.pnpm-store/v10/files/b1/300ac7fca3be8eed598f5fc79786e5b9ed299773bc602346937f5dfc4dc7ae02570240c0d806755f49d2422f5e296f22bc62c0e6ee29197bd902806e665128
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

35 lines
1.2 KiB
Plaintext

import { createHandler as createRawHandler, } from '../../handler.mjs';
/**
* Create a GraphQL over HTTP spec compliant request handler for netlify functions
*
* @category Server/@netlify/functions
*/
export function createHandler(options) {
const handler = createRawHandler(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 };
}
};
}