Files
klz-cables.com/.pnpm-store/v10/files/2b/0a35dd9d31fe59da1b186d554ca6d97f32d26c911840f25b4347c96f77c4c81bf2141227424507543e8053ce09d9b5655fc0230a202e103f6cdd6606012a1b
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

28 lines
1007 B
Plaintext

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