graphql_file_validate.module in GraphQL 8.4
Test module for file validation.
File
tests/modules/graphql_file_validate/graphql_file_validate.moduleView source
<?php
/**
* @file
* Test module for file validation.
*/
use Drupal\file\FileInterface;
/**
* Implements hook_file_validate().
*/
function graphql_file_validate(FileInterface $file) : void {
if (!file_exists($file
->getFileUri())) {
throw new \Exception('File does not exist during validation: ' . $file
->getFileUri());
}
}
Functions
Name![]() |
Description |
---|---|
graphql_file_validate | Implements hook_file_validate(). |