Maybe it's too late, but on Keystone v5, there is a hook that you can add,
validateInput, where you can add the resolver data as argument and an
error handle. There you can return this error with a string in order to show the error message. example:
const schema = {
fields: {
...other_fields,
projectVideo: {
type: File,
adapter: S3FileAdapter,
hooks: {
beforeChange,
validateInput: ({ resolvedData, addFieldValidationError }) => {
if (!resolvedData.projectVideo.mimetype.match('video/'))
return addFieldValidationError('File must be a video file type (WEBM, MP4, etc.)')
}
}
},
hooks: {
afterDelete
}
}
Hope this help to anyone.