Files
klz-cables.com/.pnpm-store/v10/files/68/61f36901ff591f956883d971183374c58a7df042544178522fa36c64c4a9cd1843ad9d4f0913ccfe14dc8ba116b01ee62eeb39cb773cadf89232e5dc62096c
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

29 lines
1.1 KiB
Plaintext

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