public function testExecutesUnionTypesWithInlineFragments()
{
// This is the valid version of the query in the above test.
$ast = Parser::parse('
{
__typename
name
pets {
__typename
... on Dog {
name
woofs
}
... on Cat {
name
meows
}
}
}
');
$expected = ['data' => ['__typename' => 'Person', 'name' => 'John', 'pets' => [['__typename' => 'Cat', 'name' => 'Garfield', 'meows' => false], ['__typename' => 'Dog', 'name' => 'Odie', 'woofs' => true]]]];
$this->assertEquals($expected, Executor::execute($this->schema, $ast, $this->john)->toArray());
}