<?php
/**
 * Autogenerated file by axtiva/flexible-graphql-php Do not edit it manually
 */ 
namespace Axtiva\FlexibleGraphql\Example\GraphQL;

use GraphQL\Type\Definition\Type;
use GraphQL\Type\Definition\InterfaceType;
use GraphQL\Type\Definition\ObjectType;
use GraphQL\Type\Definition\ListOfType;
use GraphQL\Type\Definition\NonNull;
use Axtiva\FlexibleGraphql\Type\EnumType;
use GraphQL\Type\Definition\InputObjectType;
use GraphQL\Type\Definition\CustomScalarType;
use GraphQL\Type\Definition\UnionType;
use GraphQL\Type\Definition\Directive;
use GraphQL\Type\Definition\FieldArgument;
use GraphQL\Type\Definition\FieldDefinition;
use GraphQL\Type\Definition\InputObjectField;
use Psr\Container\ContainerInterface;
use GraphQL\Type\Schema;

class TypeRegistry
{
    private ContainerInterface $container;
    
    /**
     * @var array<string, Type>
     */
    private array $types = [];
    
    public function __construct(ContainerInterface $container)
    {
        $this->container = $container;
    }

    public function getType(string $name): Type
    {
        return $this->types[$name] ??= $this->{$name}();
    }
    
    
            public function Query()
            {
                return new ObjectType([
            'name' => 'Query',
            'description' => NULL,
            'fields' => fn() => ['account' => FieldDefinition::create([
            'name' => 'account',
            'description' => NULL,
            'deprecationReason' => NULL,
            'resolve' => (function ($rootValue, $args, $context, $info) {
    $args = new \Axtiva\FlexibleGraphql\Example\GraphQL\ResolverArgs\Query\AccountResolverArgs($args);
    return $this->container->get('Axtiva\FlexibleGraphql\Example\GraphQL\Resolver\Query\AccountResolver')($rootValue, $args, $context, $info);
}),
            'type' => function() { return $this->getType('Account'); },
            'args' => ['id' => [
            'name' => 'id',
            'type' => function() { return Type::nonNull(function() { return Type::id(); }); },
            'defaultValue' => NULL,
            'description' => NULL,
        ]],
        ]),'sum' => FieldDefinition::create([
            'name' => 'sum',
            'description' => NULL,
            'deprecationReason' => NULL,
            'resolve' => function($rootValue, $args, $context, $info) {
                        return $this->container->get('Axtiva\FlexibleGraphql\Example\GraphQL\Directive\PlusXDirective')(
                        (function ($rootValue, $args, $context, $info) {
    
    return $this->container->get('Axtiva\FlexibleGraphql\Example\GraphQL\Resolver\Query\SumResolver')($rootValue, $args, $context, $info);
}), 
                        new \Axtiva\FlexibleGraphql\Example\GraphQL\DirectiveArgs\PlusXDirectiveArgs(array (
  'x' => '7',
)),
                        $rootValue, $args, $context, $info
                        );
                    },
            'type' => function() { return Type::int(); },
            'args' => [],
        ]),'dynamicSum' => FieldDefinition::create([
            'name' => 'dynamicSum',
            'description' => NULL,
            'deprecationReason' => NULL,
            'resolve' => function($rootValue, $args, $context, $info) {
                        return $this->container->get('Axtiva\FlexibleGraphql\Example\GraphQL\Directive\PlusXDirective')(
                        (function ($rootValue, $args, $context, $info) {
    $args = new \Axtiva\FlexibleGraphql\Example\GraphQL\ResolverArgs\Query\DynamicSumResolverArgs($args);
    return $this->container->get('Axtiva\FlexibleGraphql\Example\GraphQL\Resolver\Query\DynamicSumResolver')($rootValue, $args, $context, $info);
}), 
                        new \Axtiva\FlexibleGraphql\Example\GraphQL\DirectiveArgs\PlusXDirectiveArgs(array (
  'x' => '4',
)),
                        $rootValue, $args, $context, $info
                        );
                    },
            'type' => function() { return Type::int(); },
            'args' => ['x' => [
            'name' => 'x',
            'type' => function() { return Type::nonNull(function() { return Type::int(); }); },
            'defaultValue' => NULL,
            'description' => NULL,
        ],'y' => [
            'name' => 'y',
            'type' => function() { return Type::nonNull(function() { return Type::int(); }); },
            'defaultValue' => NULL,
            'description' => NULL,
        ]],
        ]),'addHour' => FieldDefinition::create([
            'name' => 'addHour',
            'description' => NULL,
            'deprecationReason' => NULL,
            'resolve' => (function ($rootValue, $args, $context, $info) {
    $args = new \Axtiva\FlexibleGraphql\Example\GraphQL\ResolverArgs\Query\AddHourResolverArgs($args);
    return $this->container->get('Axtiva\FlexibleGraphql\Example\GraphQL\Resolver\Query\AddHourResolver')($rootValue, $args, $context, $info);
}),
            'type' => function() { return $this->getType('DateTime'); },
            'args' => ['date' => [
            'name' => 'date',
            'type' => function() { return Type::nonNull(function() { return $this->getType('DateTime'); }); },
            'defaultValue' => NULL,
            'description' => NULL,
        ]],
        ])],
        ]);
            }
        


            public function Account()
            {
                return new ObjectType([
            'name' => 'Account',
            'description' => NULL,
            'fields' => fn() => ['id' => FieldDefinition::create([
            'name' => 'id',
            'description' => NULL,
            'deprecationReason' => NULL,
            // No resolver. Default used
            'type' => function() { return Type::nonNull(function() { return Type::id(); }); },
            'args' => [],
        ]),'number' => FieldDefinition::create([
            'name' => 'number',
            'description' => NULL,
            'deprecationReason' => NULL,
            'resolve' => function($rootValue, $args, $context, $info) {
                        return $this->container->get('Axtiva\FlexibleGraphql\Example\GraphQL\Directive\UppercaseDirective')(
                        \Axtiva\FlexibleGraphql\Resolver\Foundation\DefaultResolver::getInstance(), 
                        array (
),
                        $rootValue, $args, $context, $info
                        );
                    },
            'type' => function() { return Type::nonNull(function() { return Type::string(); }); },
            'args' => [],
        ]),'currency' => FieldDefinition::create([
            'name' => 'currency',
            'description' => NULL,
            'deprecationReason' => NULL,
            // No resolver. Default used
            'type' => function() { return Type::nonNull(function() { return $this->getType('Currency'); }); },
            'args' => [],
        ]),'transactions' => FieldDefinition::create([
            'name' => 'transactions',
            'description' => NULL,
            'deprecationReason' => NULL,
            'resolve' => (function ($rootValue, $args, $context, $info) {
    
    return $this->container->get('Axtiva\FlexibleGraphql\Example\GraphQL\Resolver\Account\TransactionsResolver')($rootValue, $args, $context, $info);
}),
            'type' => function() { return Type::nonNull(function() { return new ListOfType(function() { return Type::nonNull(function() { return $this->getType('Transaction'); }); }); }); },
            'args' => [],
        ])],
        ]);
            }
        


            public function Node()
            {
                return new InterfaceType([
            'name' => 'Node',
            'description' => NULL,
            'fields' => fn() => ['id' => FieldDefinition::create([
            'name' => 'id',
            'description' => NULL,
            'deprecationReason' => NULL,
            // No resolver. Default used
            'type' => function() { return Type::nonNull(function() { return Type::id(); }); },
            'args' => [],
        ])],
        ]);
            }
        


            public function Currency()
            {
                return new UnionType([
            'name' => 'Currency',
            'description' => NULL,
            'types' => function() { return [$this->getType('NamedCurrency'),$this->getType('CodedCurrency')];},
            'resolveType' => $this->container->get('Axtiva\FlexibleGraphql\Example\GraphQL\UnionResolveType\CurrencyTypeResolver'),
        ]);
            }
        


            public function NamedCurrency()
            {
                return new ObjectType([
            'name' => 'NamedCurrency',
            'description' => NULL,
            'fields' => fn() => ['id' => FieldDefinition::create([
            'name' => 'id',
            'description' => NULL,
            'deprecationReason' => NULL,
            // No resolver. Default used
            'type' => function() { return Type::nonNull(function() { return Type::id(); }); },
            'args' => [],
        ]),'name' => FieldDefinition::create([
            'name' => 'name',
            'description' => NULL,
            'deprecationReason' => NULL,
            // No resolver. Default used
            'type' => function() { return Type::nonNull(function() { return Type::string(); }); },
            'args' => [],
        ])],
        ]);
            }
        


            public function CodedCurrency()
            {
                return new ObjectType([
            'name' => 'CodedCurrency',
            'description' => NULL,
            'fields' => fn() => ['id' => FieldDefinition::create([
            'name' => 'id',
            'description' => NULL,
            'deprecationReason' => NULL,
            // No resolver. Default used
            'type' => function() { return Type::nonNull(function() { return Type::id(); }); },
            'args' => [],
        ]),'code' => FieldDefinition::create([
            'name' => 'code',
            'description' => NULL,
            'deprecationReason' => NULL,
            // No resolver. Default used
            'type' => function() { return Type::nonNull(function() { return Type::int(); }); },
            'args' => [],
        ])],
        ]);
            }
        


            public function Transaction()
            {
                return new ObjectType([
            'name' => 'Transaction',
            'description' => NULL,
            'fields' => fn() => ['id' => FieldDefinition::create([
            'name' => 'id',
            'description' => NULL,
            'deprecationReason' => NULL,
            // No resolver. Default used
            'type' => function() { return Type::nonNull(function() { return Type::id(); }); },
            'args' => [],
        ]),'amount' => FieldDefinition::create([
            'name' => 'amount',
            'description' => NULL,
            'deprecationReason' => NULL,
            // No resolver. Default used
            'type' => function() { return Type::nonNull(function() { return Type::int(); }); },
            'args' => [],
        ]),'ups' => FieldDefinition::create([
            'name' => 'ups',
            'description' => NULL,
            'deprecationReason' => NULL,
            // No resolver. Default used
            'type' => function() { return Type::string(); },
            'args' => [],
        ]),'createdAt' => FieldDefinition::create([
            'name' => 'createdAt',
            'description' => NULL,
            'deprecationReason' => NULL,
            // No resolver. Default used
            'type' => function() { return $this->getType('DateTime'); },
            'args' => [],
        ]),'status' => FieldDefinition::create([
            'name' => 'status',
            'description' => NULL,
            'deprecationReason' => NULL,
            'resolve' => (function ($rootValue, $args, $context, $info) {
    
    return $this->container->get('Axtiva\FlexibleGraphql\Example\GraphQL\Resolver\Transaction\StatusResolver')($rootValue, $args, $context, $info);
}),
            'type' => function() { return Type::nonNull(function() { return $this->getType('TransactionStatus'); }); },
            'args' => [],
        ])],
        ]);
            }
        


            public function DateTime()
            {
                return new CustomScalarType([
            'name' => 'DateTime',
            'description' => NULL,
            'serialize' => function($value) {return ($this->container->get('Axtiva\FlexibleGraphql\Example\GraphQL\Scalar\DateTimeScalar'))->serialize($value);},
            'parseValue' => function($value) {return ($this->container->get('Axtiva\FlexibleGraphql\Example\GraphQL\Scalar\DateTimeScalar'))->parseValue($value);},
            'parseLiteral' => function($value, $variables) {return ($this->container->get('Axtiva\FlexibleGraphql\Example\GraphQL\Scalar\DateTimeScalar'))->parseLiteral($value, $variables);},
        ]);
            }
        


            public function TransactionStatus()
            {
                return new EnumType([
        'name' => 'TransactionStatus',
        'description' => 'TRANSACTION STATUS DOC',
        'values' => ['NEW' => [
            'name' => 'NEW', 
            'value' => 'NEW',
            'description' => NULL,
            'deprecationReason' => NULL,
            ],
'SUCCESS' => [
            'name' => 'SUCCESS', 
            'value' => 'SUCCESS',
            'description' => 'SUCCESS DOC',
            'deprecationReason' => NULL,
            ],
'FAIL' => [
            'name' => 'FAIL', 
            'value' => 'FAIL',
            'description' => NULL,
            'deprecationReason' => NULL,
            ]],
        ]);
            }
        


            public function HelloWorld()
            {
                return new CustomScalarType([
            'name' => 'HelloWorld',
            'description' => NULL,

        ]);
            }
        

    public function Mutation()
    {
        return new ObjectType(['name' => 'Mutation']);
    }


    public function directive_uppercase()
    {
        static $directive = null;
        if ($directive === null) {
            $directive = new Directive([
            'name' => 'uppercase',
            'description' => 'CAPITALIZE ALL LETTERS IN STRING',
            'isRepeatable' => false,
            'locations' => ['FIELD','FIELD_DEFINITION'],
            'args' => [
                
            ],
        ]);
        }
        
        return $directive;
    }
        


    public function directive_plusX()
    {
        static $directive = null;
        if ($directive === null) {
            $directive = new Directive([
            'name' => 'plusX',
            'description' => NULL,
            'isRepeatable' => false,
            'locations' => ['FIELD','FIELD_DEFINITION'],
            'args' => [
                [
            'name' => 'x',
            'type' => function() { return Type::nonNull(function() { return Type::int(); }); },
            'defaultValue' => NULL,
            'description' => NULL,
        ]
            ],
        ]);
        }
        
        return $directive;
    }
        


    public function getDirectives()
    {
        return [$this->directive_uppercase(),$this->directive_plusX()];
    }
        

}
