Files
klz-cables.com/.pnpm-store/v10/files/17/5f3372aa56ca17eda53de2669ac9a45d3433e505f1aaf716ce968b53d62b74380e15292da9ae379f7a01193e9af3611b56fea8ad6fd79937cb1eaed080d889
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

42 lines
1.0 KiB
Plaintext

'use strict';
Object.defineProperty(exports, '__esModule', {
value: true,
});
exports.UniqueFragmentNamesRule = UniqueFragmentNamesRule;
var _GraphQLError = require('../../error/GraphQLError.js');
/**
* Unique fragment names
*
* A GraphQL document is only valid if all defined fragments have unique names.
*
* See https://spec.graphql.org/draft/#sec-Fragment-Name-Uniqueness
*/
function UniqueFragmentNamesRule(context) {
const knownFragmentNames = Object.create(null);
return {
OperationDefinition: () => false,
FragmentDefinition(node) {
const fragmentName = node.name.value;
if (knownFragmentNames[fragmentName]) {
context.reportError(
new _GraphQLError.GraphQLError(
`There can be only one fragment named "${fragmentName}".`,
{
nodes: [knownFragmentNames[fragmentName], node.name],
},
),
);
} else {
knownFragmentNames[fragmentName] = node.name;
}
return false;
},
};
}