public function testThrowsIfUnknownOperationNameIsProvided()
{
$doc = 'query Example { a } query OtherExample { a }';
$data = ['a' => 'b'];
$ast = Parser::parse($doc);
$schema = new Schema(['query' => new ObjectType(['name' => 'Type', 'fields' => ['a' => ['type' => Type::string()]]])]);
try {
Executor::execute($schema, $ast, $data, null, null, 'UnknownExample');
$this->fail('Expected exception was not thrown');
} catch (Error $e) {
$this->assertEquals('Unknown operation named "UnknownExample".', $e->getMessage());
}
}