Files
30-seconds-of-code/node_modules/graphql/utilities/isValidJSValue.mjs
2019-08-20 15:52:05 +02:00

15 lines
371 B
JavaScript

/* istanbul ignore file */
import { coerceValue } from './coerceValue';
/**
* Deprecated. Use coerceValue() directly for richer information.
*
* This function will be removed in v15
*/
export function isValidJSValue(value, type) {
var errors = coerceValue(value, type).errors;
return errors ? errors.map(function (error) {
return error.message;
}) : [];
}