Initial Save
This commit is contained in:
19
node_modules/graphql/utilities/isValidJSValue.js.flow
generated
vendored
Normal file
19
node_modules/graphql/utilities/isValidJSValue.js.flow
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
// @flow strict
|
||||
|
||||
/* istanbul ignore file */
|
||||
import { type GraphQLInputType } from '../type/definition';
|
||||
|
||||
import { coerceValue } from './coerceValue';
|
||||
|
||||
/**
|
||||
* Deprecated. Use coerceInputValue() directly for richer information.
|
||||
*
|
||||
* This function will be removed in v15
|
||||
*/
|
||||
export function isValidJSValue(
|
||||
value: mixed,
|
||||
type: GraphQLInputType,
|
||||
): Array<string> {
|
||||
const errors = coerceValue(value, type).errors;
|
||||
return errors ? errors.map(error => error.message) : [];
|
||||
}
|
||||
Reference in New Issue
Block a user