Files
klz-cables.com/.pnpm-store/v10/files/1f/c1ece88c21c34dbab55049eebaf005696f8a34f1f198665f29cc88949ecf4310b07a954302ceade5d5b1351bad06c75cf9837cd9e46e3c66d2f6bf323a7814
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
952 B
Plaintext

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