<?xml version="1.0"?>
<!--
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="Magento\CatalogGraphQl\Model\ProductInterfaceTypeResolverComposite">
        <arguments>
            <argument name="productTypeNameResolvers" xsi:type="array">
                <item name="configurable_product_type_resolver" xsi:type="object">Magento\ConfigurableProductGraphQl\Model\ConfigurableProductTypeResolver</item>
            </argument>
        </arguments>
    </type>
    <type name="Magento\Framework\GraphQl\Schema\Type\Entity\DefaultMapper">
        <arguments>
            <argument name="map" xsi:type="array">
                <item name="catalog_product" xsi:type="array">
                    <item name="configurable" xsi:type="string">ConfigurableProduct</item>
                </item>
            </argument>
        </arguments>
    </type>
    <type name="Magento\QuoteGraphQl\Model\Cart\BuyRequest\BuyRequestBuilder">
        <arguments>
            <argument name="providers" xsi:type="array">
                <item name="super_attribute" xsi:type="object">Magento\ConfigurableProductGraphQl\Model\Cart\BuyRequest\SuperAttributeDataProvider</item>
            </argument>
        </arguments>
    </type>
    <type name="Magento\CatalogGraphQl\Model\Resolver\Product\Price\ProviderPool">
        <arguments>
            <argument name="providers" xsi:type="array">
                <item name="configurable" xsi:type="object">Magento\ConfigurableProductGraphQl\Model\Resolver\Product\Price\Provider</item>
            </argument>
        </arguments>
    </type>
    <type name="Magento\WishlistGraphQl\Model\Resolver\Type\WishlistItemType">
        <arguments>
            <argument name="supportedTypes" xsi:type="array">
                <item name="configurable" xsi:type="string">ConfigurableWishlistItem</item>
            </argument>
        </arguments>
    </type>

    <type name="Magento\ConfigurableProduct\Model\Product\Type\Configurable">
        <plugin name="used_products_cache_graphql" type="Magento\ConfigurableProduct\Model\Plugin\Frontend\UsedProductsCache" />
    </type>

    <type name="Magento\ConfigurableProduct\Model\ResourceModel\Attribute\OptionSelectBuilderInterface">
        <plugin name="Magento_ConfigurableProduct_Plugin_Model_ResourceModel_Attribute_InStockOptionSelectBuilder_GraphQl" type="Magento\ConfigurableProduct\Plugin\Model\ResourceModel\Attribute\InStockOptionSelectBuilder"/>
        <plugin name="option_select_website_filter" type="Magento\ConfigurableProduct\Plugin\Model\ResourceModel\Attribute\ScopedOptionSelectBuilder"/>
    </type>

    <type name="Magento\StoreGraphQl\Model\Resolver\Store\StoreConfigDataProvider">
        <arguments>
            <argument name="extendedConfigData" xsi:type="array">
                <item name="configurable_thumbnail_source" xsi:type="string">checkout/cart/configurable_product_image</item>
            </argument>
        </arguments>
    </type>

    <type name="Magento\UrlRewriteGraphQl\Model\RoutableInterfaceTypeResolver">
        <arguments>
            <argument name="productTypeNameResolvers" xsi:type="array">
                <item name="configurable_product_type_resolver" xsi:type="object">Magento\ConfigurableProductGraphQl\Model\ConfigurableProductTypeResolver</item>
            </argument>
        </arguments>
    </type>
    <type name="Magento\ConfigurableProduct\Model\Product\Configuration\Item\ItemProductResolver">
        <plugin name="configured_variant" type="Magento\ConfigurableProductGraphQl\Plugin\Product\Configuration\Item\ItemResolver"/>
    </type>
    <type name="Magento\ConfigurableProduct\Pricing\Price\ConfigurableOptionsCompositeFilter">
        <arguments>
            <argument name="configurableOptionsFilters" xsi:type="array">
                <item name="status" xsi:type="object">Magento\ConfigurableProduct\Pricing\Price\ConfigurableOptionsStatusFilter</item>
                <item name="stock_status" xsi:type="object">Magento\ConfigurableProduct\Pricing\Price\ConfigurableOptionsStockStatusFilter</item>
            </argument>
        </arguments>
    </type>
    <type name="Magento\ConfigurableProduct\Model\ResourceModel\Product\Type\Configurable\Product\Collection">
        <plugin name="add_stock_information" type="Magento\ConfigurableProductGraphQl\Plugin\AddStockStatusToCollection" />
    </type>
    <type name="Magento\Quote\Model\Quote">
        <plugin name="update_customized_options" type="Magento\ConfigurableProductGraphQl\Plugin\Quote\UpdateCustomizedOptions"/>
    </type>
</config>
