Files
klz-cables.com/.pnpm-store/v10/files/39/ec00517dc8d3e0039665dcc31c9e03275f8634164d22867302deca5be91b202927a4283df6a5591a5ebf28bbcbf96e671cd19822856276ca1377571ed3e538
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

31 lines
1.0 KiB
Plaintext

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