<?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>

        <!-- Event listener -->

        <service id="api_platform.doctrine.orm.listener.mercure.publish" class="ApiPlatform\Symfony\Doctrine\EventListener\PublishMercureUpdatesListener">
            <argument type="service" id="api_platform.resource_class_resolver" />
            <argument type="service" id="api_platform.iri_converter" />
            <argument type="service" id="api_platform.metadata.resource.metadata_collection_factory" />
            <argument type="service" id="api_platform.serializer" />
            <argument>%api_platform.formats%</argument>
            <argument type="service" id="messenger.default_bus" on-invalid="ignore" />
            <argument type="service" id="Symfony\Component\Mercure\HubRegistry" />
            <argument type="service" id="api_platform.graphql.subscription.subscription_manager" on-invalid="ignore" />
            <argument type="service" id="api_platform.graphql.subscription.mercure_iri_generator" on-invalid="ignore" />
            <argument>null</argument>
            <argument>%api_platform.mercure.include_type%</argument>

            <tag name="doctrine.event_listener" event="onFlush" />
            <tag name="doctrine.event_listener" event="postFlush" />
        </service>

    </services>

</container>
