Files
klz-cables.com/.pnpm-store/v10/files/1b/7e9cf6e8f13bb9c517d18ed5973a9956640c1bb32a45087eb0d73aa4ef6e44cdd32c8a1fa32083fed8a45df1f8fb16251e2487fda46a06d64bd3288d102ce0
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

68 lines
1.5 KiB
Plaintext

'use strict';
Object.defineProperty(exports, '__esModule', {
value: true,
});
exports.getOperationRootType = getOperationRootType;
var _GraphQLError = require('../error/GraphQLError.js');
/**
* Extracts the root type of the operation from the schema.
*
* @deprecated Please use `GraphQLSchema.getRootType` instead. Will be removed in v17
*/
function getOperationRootType(schema, operation) {
if (operation.operation === 'query') {
const queryType = schema.getQueryType();
if (!queryType) {
throw new _GraphQLError.GraphQLError(
'Schema does not define the required query root type.',
{
nodes: operation,
},
);
}
return queryType;
}
if (operation.operation === 'mutation') {
const mutationType = schema.getMutationType();
if (!mutationType) {
throw new _GraphQLError.GraphQLError(
'Schema is not configured for mutations.',
{
nodes: operation,
},
);
}
return mutationType;
}
if (operation.operation === 'subscription') {
const subscriptionType = schema.getSubscriptionType();
if (!subscriptionType) {
throw new _GraphQLError.GraphQLError(
'Schema is not configured for subscriptions.',
{
nodes: operation,
},
);
}
return subscriptionType;
}
throw new _GraphQLError.GraphQLError(
'Can only have query, mutation and subscription operations.',
{
nodes: operation,
},
);
}