import * as Yup from 'yup'; import { GraphQLResolveInfo } from 'graphql'; export declare type YupMiddlewareErrorContext = { root: any; args: TArgs; context: TContext; info: GraphQLResolveInfo; }; export declare type YupMiddlewareOptions = { errorPayloadBuilder?: (error: Yup.ValidationError, errorContext: YupMiddlewareErrorContext) => any; shouldTransformArgs?: boolean; yupOptions?: Parameters[1]; }; export declare type YupMiddlewareFieldValidationError = { field: string; errors: string[]; }; export declare type YupMiddlewareDefaultError = { message: string; details: YupMiddlewareFieldValidationError[]; }; export interface GraphQLExtensionsYupMiddleware<_TSource, _TContext, _TArgs extends Record = Record> { validationOptions?: YupMiddlewareOptions; validationSchema: Yup.ObjectSchema<_TArgs> | ((root: _TSource, args: _TArgs, context: _TContext, info: GraphQLResolveInfo) => Yup.ObjectSchema<_TArgs>); }