<?php

declare (strict_types=1);
namespace idoit\Module\JDisc\Graphql\Schema\UnionResolveType;

use GraphQL\Type\Definition\ResolveInfo;
use Axtiva\FlexibleGraphql\Resolver\UnionResolveTypeInterface;
use idoit\Module\JDisc\Graphql\Schema\Model\AliasFieldDescriptionType;
use idoit\Module\JDisc\Graphql\Schema\Model\CustomAttributeFieldDescriptionType;
use idoit\Module\JDisc\Graphql\Schema\Model\CustomAttributeTableFieldDescriptionType;
use idoit\Module\JDisc\Graphql\Schema\Model\FieldDescriptionType;
use idoit\Module\JDisc\Graphql\Schema\Model\IdFieldDescriptionType;
use idoit\Module\JDisc\Graphql\Schema\Model\InvisibleIdFieldDescriptionType;
use idoit\Module\JDisc\Graphql\Schema\Model\KeyDescriptionType;
use idoit\Module\JDisc\Graphql\Schema\Model\WbemBrowserFieldDescriptionType;

/**
 * This code is @generated by axtiva/flexible-graphql-php
 * and will be regenerated. Do not edit it manually
 */
final class IFieldDescriptionTypeResolver implements UnionResolveTypeInterface
{
    public function __invoke($model, $context, ResolveInfo $info)
    {
        if (isset($model)) {
            switch (get_class($model)) {
                case AliasFieldDescriptionType::class:
                    return $info->schema->getType('AliasFieldDescription');
                case CustomAttributeFieldDescriptionType::class:
                    return $info->schema->getType('CustomAttributeFieldDescription');
                case CustomAttributeTableFieldDescriptionType::class:
                    return $info->schema->getType('CustomAttributeTableFieldDescription');
                case FieldDescriptionType::class:
                    return $info->schema->getType('FieldDescription');
                case IdFieldDescriptionType::class:
                    return $info->schema->getType('IdFieldDescription');
                case InvisibleIdFieldDescriptionType::class:
                    return $info->schema->getType('InvisibleIdFieldDescription');
                case KeyDescriptionType::class:
                    return $info->schema->getType('KeyDescription');
                case WbemBrowserFieldDescriptionType::class:
                    return $info->schema->getType('WbemBrowserFieldDescription');
            }
        }
        return null;
    }
}