GraphQL\Validator\Rules\ArgumentsOfCorrectType::badValueMessage PHP Method

badValueMessage() static public method

static public badValueMessage ( $argName, $type, $value, $verboseErrors = [] )
    static function badValueMessage($argName, $type, $value, $verboseErrors = [])
    {
        $message = $verboseErrors ? "\n" . implode("\n", $verboseErrors) : '';
        return "Argument \"{$argName}\" has invalid value {$value}.{$message}";
    }

Usage Example

 function badValue($argName, $typeName, $value, $line, $column, $errors = null)
 {
     $realErrors = !$errors ? ["Expected type \"{$typeName}\", found {$value}."] : $errors;
     return FormattedError::create(ArgumentsOfCorrectType::badValueMessage($argName, $typeName, $value, $realErrors), [new SourceLocation($line, $column)]);
 }
All Usage Examples Of GraphQL\Validator\Rules\ArgumentsOfCorrectType::badValueMessage
ArgumentsOfCorrectType