Initial Save

This commit is contained in:
jackbeeby
2025-03-28 12:30:19 +11:00
parent e381994f19
commit d8773925e8
9910 changed files with 982718 additions and 0 deletions

32
node_modules/graphql/utilities/coerceValue.mjs generated vendored Normal file
View File

@@ -0,0 +1,32 @@
/* istanbul ignore file */
import inspect from '../jsutils/inspect';
import printPathArray from '../jsutils/printPathArray';
import { pathToArray } from '../jsutils/Path';
import { GraphQLError } from '../error/GraphQLError';
import { coerceInputValue } from './coerceInputValue';
/**
* Deprecated. Use coerceInputValue() directly for richer information.
*
* This function will be removed in v15
*/
export function coerceValue(inputValue, type, blameNode, path) {
var errors = [];
var value = coerceInputValue(inputValue, type, function (errorPath, invalidValue, error) {
var errorPrefix = 'Invalid value ' + inspect(invalidValue);
var pathArray = [].concat(pathToArray(path), errorPath);
if (pathArray.length > 0) {
errorPrefix += " at \"value".concat(printPathArray(pathArray), "\"");
}
errors.push(new GraphQLError(errorPrefix + ': ' + error.message, blameNode, undefined, undefined, undefined, error.originalError));
});
return errors.length > 0 ? {
errors: errors,
value: undefined
} : {
errors: undefined,
value: value
};
}