<?xml version="1.0" ?>

<container xmlns="http://symfony.com/schema/dic/services"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">

    <services>
        <service id="api_platform.graphql.executor" class="ApiPlatform\GraphQl\Executor" public="false" />

        <!-- Resolvers -->

        <service id="api_platform.graphql.query_resolver_locator" class="Symfony\Component\DependencyInjection\ServiceLocator">
            <tag name="container.service_locator" />
        </service>

        <service id="api_platform.graphql.mutation_resolver_locator" class="Symfony\Component\DependencyInjection\ServiceLocator">
            <tag name="container.service_locator" />
        </service>

        <!-- Type -->

        <service id="api_platform.graphql.iterable_type" class="ApiPlatform\GraphQl\Type\Definition\IterableType">
            <tag name="api_platform.graphql.type" />
        </service>

        <service id="api_platform.graphql.upload_type" class="ApiPlatform\GraphQl\Type\Definition\UploadType">
            <tag name="api_platform.graphql.type" />
        </service>

        <service id="api_platform.graphql.type_locator" class="Symfony\Component\DependencyInjection\ServiceLocator">
            <tag name="container.service_locator" />
        </service>

        <service id="api_platform.graphql.types_container" class="ApiPlatform\GraphQl\Type\TypesContainer" />

        <service id="api_platform.graphql.types_factory" class="ApiPlatform\GraphQl\Type\TypesFactory">
            <argument type="service" id="api_platform.graphql.type_locator" />
        </service>

        <service id="api_platform.graphql.fields_builder_locator" class="Symfony\Component\DependencyInjection\ServiceLocator" public="false">
            <argument type="collection">
                <argument type="service" id="api_platform.graphql.fields_builder" />
            </argument>
            <tag name="container.service_locator"/>
        </service>

        <!-- Action -->

        <service id="api_platform.graphql.action.entrypoint" class="ApiPlatform\GraphQl\Action\EntrypointAction" public="true">
            <argument type="service" id="api_platform.graphql.schema_builder" />
            <argument type="service" id="api_platform.graphql.executor" />
            <argument type="service" id="api_platform.graphql.action.graphiql" />
            <argument type="service" id="api_platform.graphql.action.graphql_playground" />
            <argument type="service" id="serializer" />
            <argument type="service" id="api_platform.graphql.error_handler" />
            <argument>%kernel.debug%</argument>
            <argument>%api_platform.graphql.graphiql.enabled%</argument>
            <argument>%api_platform.graphql.graphql_playground.enabled%</argument>
            <argument>%api_platform.graphql.default_ide%</argument>
        </service>

        <service id="api_platform.graphql.action.graphiql" class="ApiPlatform\GraphQl\Action\GraphiQlAction" public="true">
            <argument type="service" id="twig" />
            <argument type="service" id="api_platform.router" />
            <argument>%api_platform.graphql.graphiql.enabled%</argument>
            <argument>%api_platform.title%</argument>
            <argument>%api_platform.asset_package%</argument>
        </service>

        <service id="api_platform.graphql.action.graphql_playground" class="ApiPlatform\GraphQl\Action\GraphQlPlaygroundAction" public="true">
            <argument type="service" id="twig" />
            <argument type="service" id="api_platform.router" />
            <argument>%api_platform.graphql.graphql_playground.enabled%</argument>
            <argument>%api_platform.title%</argument>
            <argument>%api_platform.asset_package%</argument>
        </service>

        <!-- Error -->

        <service id="api_platform.graphql.error_handler" class="ApiPlatform\GraphQl\Error\ErrorHandler" public="false" />

        <service id="api_platform.graphql.subscription.subscription_identifier_generator" class="ApiPlatform\GraphQl\Subscription\SubscriptionIdentifierGenerator" />

        <service id="api_platform.graphql.cache.subscription" parent="cache.system" public="false">
            <tag name="cache.pool" />
        </service>

        <!-- Command -->

        <service id="api_platform.graphql.command.export_command" class="ApiPlatform\Symfony\Bundle\Command\GraphQlExportCommand">
            <argument type="service" id="api_platform.graphql.schema_builder" />
            <tag name="console.command" />
        </service>
    </services>

</container>
