/**
* @it fails as expected on the __type root field without an arg
*/
public function testFailsAsExpectedOnThe__typeRootFieldWithoutAnArg()
{
$TestType = new ObjectType(['name' => 'TestType', 'fields' => ['testField' => ['type' => Type::string()]]]);
$schema = new Schema(['query' => $TestType]);
$request = '
{
__type {
name
}
}
';
$expected = ['errors' => [FormattedError::create(ProvidedNonNullArguments::missingFieldArgMessage('__type', 'name', 'String!'), [new SourceLocation(3, 9)])]];
$this->assertEquals($expected, GraphQL::execute($schema, $request));
}