/**
* Return implementations of `type` that include `fieldName` as a valid field.
*
* @param Schema $schema
* @param AbstractType $type
* @param $fieldName
* @return array
*/
static function getImplementationsIncludingField(Schema $schema, AbstractType $type, $fieldName)
{
$types = $schema->getPossibleTypes($type);
$types = Utils::filter($types, function ($t) use($fieldName) {
return isset($t->getFields()[$fieldName]);
});
$types = Utils::map($types, function ($t) {
return $t->name;
});
sort($types);
return $types;
}