forked from scandipwa/catalog-graphql
-
Notifications
You must be signed in to change notification settings - Fork 0
/
di.xml
132 lines (106 loc) · 7.04 KB
/
di.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
<?xml version="1.0"?>
<!--
/**
* ScandiPWA_CatalogGraphQl
*
* @category Scandiweb
* @package ScandiPWA_CatalogGraphQl
* @author Viktors Pliska <info@scandiweb.com>
* @copyright Copyright (c) 2018 Scandiweb, Ltd (https://scandiweb.com)
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<type name="Magento\CatalogGraphQl\Model\Resolver\Products\FilterArgument\ProductEntityAttributesForAst">
<plugin name="ScandiPWA::ProductEntityAttributesForAst" type="ScandiPWA\CatalogGraphQl\Plugin\Resolver\Products\FilterArgument\ProductEntityAttributesForAst" sortOrder="1" disabled="false"/>
</type>
<preference for="Magento\CatalogGraphQl\Model\Resolver\Products\DataProvider\Product\CollectionProcessor\StockProcessor"
type="ScandiPWA\CatalogGraphQl\Model\Resolver\Products\DataProvider\Product\CollectionProcessor\StockProcessor" />
<preference for="Magento\CatalogGraphQl\Model\Resolver\Products\DataProvider\Product\CollectionProcessor\AttributeProcessor"
type="ScandiPWA\CatalogGraphQl\Model\Resolver\Products\DataProvider\Product\CollectionProcessor\AttributeProcessor" />
<virtualType name="ScandiPWA\CatalogGraphQl\Model\Search\PageSizeProvider" type="Magento\Search\Model\Search\PageSizeProvider">
<arguments>
<argument name="pageSizeBySearchEngine" xsi:type="array">
<item name="elasticsearch" xsi:type="number">10000</item>
<item name="elasticsearch5" xsi:type="number">10000</item>
</argument>
</arguments>
</virtualType>
<type name="ScandiPWA\CatalogGraphQl\Plugin\Resolver\Products\FilterArgument\ProductEntityAttributesForAst">
<arguments>
<argument name="attributes" xsi:type="array">
<item name="news_to_date" xsi:type="string">news_to_date</item>
<item name="category_url_key" xsi:type="string">category_url_key</item>
<item name="category_url_path" xsi:type="string">category_url_path</item>
<item name="conditions" xsi:type="string">conditions</item>
</argument>
</arguments>
</type>
<!-- Prevent Magento to dynamically build product and category attributes -->
<virtualType name="ScandiPWA\CatalogGraphQl\GraphQlSchemaStitching\Reader" type="Magento\Framework\GraphQlSchemaStitching\Common\Reader">
<arguments>
<argument name="readers" xsi:type="array">
<item name="graphql_reader" xsi:type="object">Magento\Framework\GraphQlSchemaStitching\GraphQlReader</item>
<item name="productFiltersDynamicAttributeReader" xsi:type="object">ScandiPWA\CatalogGraphQl\Model\Config\ProductAttributeReader</item>
<item name="categoryDynamicAttributeReader" xsi:type="object">Magento\CatalogGraphQl\Model\Config\CategoryAttributeReader</item>
</argument>
</arguments>
</virtualType>
<preference for="Magento\Framework\GraphQlSchemaStitching\Reader"
type="ScandiPWA\CatalogGraphQl\GraphQlSchemaStitching\Reader"/>
<!-- Prevent Magento to dynamically build product and category attributes -->
<type name="Magento\CatalogGraphQl\Model\Resolver\Products\Query\Search">
<arguments>
<argument name="pageSize" xsi:type="object">ScandiPWA\CatalogGraphQl\Model\Search\PageSizeProvider</argument>
</arguments>
</type>
<preference for="Magento\Catalog\Model\ResourceModel\Layer\Filter\Attribute"
type="ScandiPWA\CatalogGraphQl\Model\ResourceModel\Layer\Filter\Attribute" />
<preference for="Magento\CatalogGraphQl\Model\Resolver\Product\MediaGallery\Url"
type="ScandiPWA\CatalogGraphQl\Model\Resolver\Product\MediaGallery\Url" />
<preference for="Magento\CatalogGraphQl\Model\Resolver\Product\MediaGalleryEntries"
type="ScandiPWA\CatalogGraphQl\Model\Resolver\Product\MediaGalleryEntries"/>
<preference for="Magento\CatalogGraphQl\Model\Resolver\Products\SearchResult"
type="ScandiPWA\CatalogGraphQl\Model\Resolver\Products\SearchResult"/>
<preference for="Magento\CatalogGraphQl\Model\Resolver\Products\SearchResultFactory"
type="ScandiPWA\CatalogGraphQl\Model\Resolver\Products\SearchResultFactory"/>
<preference for="Magento\CatalogGraphQl\Model\Resolver\Products"
type="ScandiPWA\CatalogGraphQl\Model\Resolver\Products"/>
<preference for="Magento\CatalogGraphQl\Model\Resolver\Product\CanonicalUrl"
type="ScandiPWA\CatalogGraphQl\Model\Resolver\Product\CanonicalUrl"/>
<preference for="Magento\CatalogGraphQl\Model\Resolver\Category\Products"
type="ScandiPWA\CatalogGraphQl\Model\Resolver\Category\Products"/>
<preference for="Magento\CatalogGraphQl\Model\Resolver\Products\DataProvider\Product"
type="ScandiPWA\CatalogGraphQl\Model\Resolver\Products\DataProvider\Product"/>
<preference for="Magento\CatalogGraphQl\Model\Resolver\Products\Query\Filter"
type="ScandiPWA\CatalogGraphQl\Model\Resolver\Products\Query\Filter"/>
<preference for="Magento\CatalogGraphQl\Model\Resolver\Products\Query\Search"
type="ScandiPWA\CatalogGraphQl\Model\Resolver\Products\Query\Search"/>
<preference for="Magento\CatalogWidget\Model\Rule\Condition\Product"
type="ScandiPWA\CatalogGraphQl\Model\Rule\Condition\Product" />
<preference for="Magento\CatalogGraphQl\Model\Resolver\LayerFilters"
type="ScandiPWA\CatalogGraphQl\Model\Resolver\LayerFilters" />
<type name="ScandiPWA\CatalogGraphQl\Model\Resolver\Products\Query\Search">
<arguments>
<argument name="pageSize" xsi:type="object">ScandiPWA\CatalogGraphQl\Model\Search\PageSizeProvider</argument>
</arguments>
</type>
<!-- Performance related changes -->
<preference for="Magento\ConfigurableProductGraphQl\Model\Resolver\ConfigurableVariant"
type="ScandiPWA\CatalogGraphQl\Model\Resolver\ConfigurableVariant" />
<type name="ScandiPWA\CatalogGraphQl\Model\Resolver\ConfigurableVariant">
<arguments>
<argument name="variantCollection" xsi:type="object">ScandiPWA\CatalogGraphQl\Model\Variant\Collection</argument>
</arguments>
</type>
<type name="Magento\CatalogGraphQl\Model\Resolver\Products\DataProvider\Product\CompositeCollectionProcessor">
<arguments>
<argument name="collectionProcessors" xsi:type="array">
<item name="images" xsi:type="object">ScandiPWA\CatalogGraphQl\Model\Resolver\Products\DataProvider\Product\CollectionProcessor\ImagesProcessor</item>
</argument>
</arguments>
</type>
<preference for="Magento\CatalogGraphQl\Model\Resolver\Product"
type="ScandiPWA\CatalogGraphQl\Model\Resolver\Product" />
<preference for="Magento\GroupedProductGraphQl\Model\Resolver\GroupedItems"
type="ScandiPWA\CatalogGraphQl\Model\Resolver\GroupedItems" />
</config>