import{Kind}from'../language/kinds';import{visit,visitWithTypeInfo}from'../language/visitor';import{ValuesOfCorrectType}from'../validation/rules/ValuesOfCorrectType';import{ValidationContext}from'../validation/ValidationContext';import{GraphQLSchema}from'../type/schema';import{TypeInfo}from'./TypeInfo';/** * Utility which determines if a value literal node is valid for an input type. * * Deprecated. Rely on validation for documents containing literal values. * * This function will be removed in v15 */exportfunctionisValidLiteralValue(type,valueNode){varemptySchema=newGraphQLSchema({});varemptyDoc={kind:Kind.DOCUMENT,definitions:[]};vartypeInfo=newTypeInfo(emptySchema,undefined,type);varcontext=newValidationContext(emptySchema,emptyDoc,typeInfo);varvisitor=ValuesOfCorrectType(context);visit(valueNode,visitWithTypeInfo(typeInfo,visitor));returncontext.getErrors();}