Files
klz-cables.com/.pnpm-store/v10/files/ec/1572cbe67714c169537241d1687ab7ead115487f4372e9a497f9e0e5c8d7bbc8687644dcf2ee15b28992d46cf1e03d55cec65070ee5d64b72c669312e0d1e0
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.2 KiB
Plaintext

'use strict';
Object.defineProperty(exports, '__esModule', {
value: true,
});
exports.NoSchemaIntrospectionCustomRule = NoSchemaIntrospectionCustomRule;
var _GraphQLError = require('../../../error/GraphQLError.js');
var _definition = require('../../../type/definition.js');
var _introspection = require('../../../type/introspection.js');
/**
* Prohibit introspection queries
*
* A GraphQL document is only valid if all fields selected are not fields that
* return an introspection type.
*
* Note: This rule is optional and is not part of the Validation section of the
* GraphQL Specification. This rule effectively disables introspection, which
* does not reflect best practices and should only be done if absolutely necessary.
*/
function NoSchemaIntrospectionCustomRule(context) {
return {
Field(node) {
const type = (0, _definition.getNamedType)(context.getType());
if (type && (0, _introspection.isIntrospectionType)(type)) {
context.reportError(
new _GraphQLError.GraphQLError(
`GraphQL introspection has been disabled, but the requested query contained the field "${node.name.value}".`,
{
nodes: node,
},
),
);
}
},
};
}