<?php

declare (strict_types=1);
namespace Axtiva\FlexibleGraphql\Example\GraphQL\UnionResolveType;

use GraphQL\Type\Definition\ResolveInfo;
use Axtiva\FlexibleGraphql\Resolver\UnionResolveTypeInterface;
use Axtiva\FlexibleGraphql\Example\GraphQL\Model\NamedCurrencyType;
use Axtiva\FlexibleGraphql\Example\GraphQL\Model\CodedCurrencyType;

/**
 * This code is @generated by axtiva/flexible-graphql-php
 * and will be regenerated. Do not edit it manually
 */
final class CurrencyTypeResolver implements UnionResolveTypeInterface
{
    public function __invoke($model, $context, ResolveInfo $info)
    {
        if (isset($model)) {
            switch (get_class($model)) {
                case NamedCurrencyType::class:
                    return $info->schema->getType('NamedCurrency');
                case CodedCurrencyType::class:
                    return $info->schema->getType('CodedCurrency');
            }
        }
        return null;
    }
}