/**
* @it does not allow unknown types to be used as values
*/
public function testDoesNotAllowUnknownTypesToBeUsedAsValues()
{
$doc = '
query q($input: UnknownType!) {
fieldWithObjectInput(input: $input)
}
';
$ast = Parser::parse($doc);
$vars = ['input' => 'whoknows'];
try {
Executor::execute($this->schema(), $ast, null, null, $vars);
$this->fail('Expected exception not thrown');
} catch (Error $error) {
$expected = FormattedError::create('Variable "$input" expected value of type "UnknownType!" which ' . 'cannot be used as an input type.', [new SourceLocation(2, 17)]);
$this->assertEquals($expected, Error::formatError($error));
}
}