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

30 lines
949 B
Plaintext

import { GraphQLScalarType, Kind } from 'graphql';
import { createGraphQLError } from '../error.js';
import { processValue } from './utilities.js';
export const GraphQLNegativeInt = /*#__PURE__*/ new GraphQLScalarType({
name: 'NegativeInt',
description: 'Integers that will have a value less than 0.',
serialize(value) {
return processValue(value, 'NegativeInt');
},
parseValue(value) {
return processValue(value, 'NegativeInt');
},
parseLiteral(ast) {
if (ast.kind !== Kind.INT) {
throw createGraphQLError(`Can only validate integers as negative integers but got a: ${ast.kind}`, {
nodes: ast,
});
}
return processValue(ast.value, 'NegativeInt');
},
extensions: {
codegenScalarType: 'number',
jsonSchema: {
title: 'NegativeInt',
type: 'integer',
maximum: 0,
},
},
});