Skip to content

Commit 1d8a6d7

Browse files
🔃 [GraphQL] Partners Acceleration Program Contributions - 2.4-develop
Accepted Community Pull Requests: - #28794: #28569:Multi-store: Missing store codes in relation t… (by @gallyamov) - #28904: #26107: Exception message on cart with no shipment items (by @michalderlatka) - #28747: #28579:DependencyTest does not analyze GraphQL schema… (by @sasha19957099) - #28757: 28563: GraphQL product search does not consider Category Permissions configuration - Pass the context as argument (by @pmarjan) - #27882: Adding Product Reviews GraphQl support (by @eduard13) Fixed GitHub Issues: - #28569: Multi-store: Missing store codes in relation to a group and website (reported by @magento-engcom-team) has been fixed in #28794 by @gallyamov in 2.4-develop branch Related commits: 1. 0b577a3 2. 1973c26 3. 5ab033d 4. ac5835b 5. 5ea15d1 6. 4fe5f8f 7. 48f8add 8. d8643e2 9. 7cb5e98 10. 2a3f775 11. d627611 12. 48749bc 13. 362b81a 14. 78ea7b8 15. e1f8b56 16. 4c994bf 17. ad896c5 18. 454695c 19. 00fbf7f 20. 3c770e2 21. d9edb5b 22. b23125e 23. 0ccadf5 - #26107: Customer got an error about Virtual Product after setting the shipping address on Cart that contains Downloadable Product only (reported by @TomashKhamlai) has been fixed in #28904 by @michalderlatka in 2.4-develop branch Related commits: 1. 1091a30 2. c8c4e06 3. 77bd613 - #28563: GraphQL product search does not consider Category Permissions configuration (reported by @magento-engcom-team) has been fixed in #28757 by @pmarjan in 2.4-develop branch Related commits: 1. 308ef0e 2. 332369d 3. 966aeba 4. 191b758 5. a5e978e 6. c535264 7. ea0ea52 8. 48f9256 9. 4ed80e3 10. d0f3415 11. a675e30 12. c689798 13. d127628 14. a87a88d - #250: Admin routing to 404 page after installation (reported by @tiagosampaio) has been fixed in #27882 by @eduard13 in 2.4-develop branch Related commits: 1. 9365b57 2. ddf7d53 3. 51e2fbc 4. 0564f78 5. 1d75c53 6. e21d3a8 7. dd796f3 8. 1b7bade 9. 9b8912e 10. 20dfcc6 11. 5809bee 12. 4fedd42 13. 64f9f00 14. 5a4b007 15. 3592cf9 16. 7089708 17. 017da27 18. a020625 19. 0111b2d 20. f168ca6 21. f443741 22. 11c7fd4 23. c9184f6 24. b974b48 25. de8598c 26. 9230db6
2 parents 878b1c9 + e886fd1 commit 1d8a6d7

File tree

71 files changed

+3168
-374
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+3168
-374
lines changed

app/code/Magento/CatalogGraphQl/Model/Resolver/Category/Products.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public function resolve(
6363
'eq' => $value['id']
6464
]
6565
];
66-
$searchResult = $this->searchQuery->getResult($args, $info);
66+
$searchResult = $this->searchQuery->getResult($args, $info, $context);
6767

6868
//possible division by 0
6969
if ($searchResult->getPageSize()) {

app/code/Magento/CatalogGraphQl/Model/Resolver/Products.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public function resolve(
6969
);
7070
}
7171

72-
$searchResult = $this->searchQuery->getResult($args, $info);
72+
$searchResult = $this->searchQuery->getResult($args, $info, $context);
7373

7474
if ($searchResult->getCurrentPage() > $searchResult->getTotalPages() && $searchResult->getTotalCount() > 0) {
7575
throw new GraphQlInputException(

app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/Deferred/Product.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use Magento\Catalog\Api\Data\ProductInterface;
1111
use Magento\CatalogGraphQl\Model\Resolver\Products\DataProvider\Product as ProductDataProvider;
1212
use Magento\Framework\Api\SearchCriteriaBuilder;
13+
use Magento\GraphQl\Model\Query\ContextInterface;
1314

1415
/**
1516
* Deferred resolver for product data.

app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/Product.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use Magento\Catalog\Api\Data\ProductSearchResultsInterfaceFactory;
1515
use Magento\Framework\Api\SearchResultsInterface;
1616
use Magento\CatalogGraphQl\Model\Resolver\Products\DataProvider\Product\CollectionProcessorInterface;
17+
use Magento\GraphQl\Model\Query\ContextInterface;
1718

1819
/**
1920
* Product field data provider, used for GraphQL resolver processing.
@@ -73,18 +74,20 @@ public function __construct(
7374
* @param string[] $attributes
7475
* @param bool $isSearch
7576
* @param bool $isChildSearch
77+
* @param ContextInterface|null $context
7678
* @return SearchResultsInterface
7779
*/
7880
public function getList(
7981
SearchCriteriaInterface $searchCriteria,
8082
array $attributes = [],
8183
bool $isSearch = false,
82-
bool $isChildSearch = false
84+
bool $isChildSearch = false,
85+
ContextInterface $context = null
8386
): SearchResultsInterface {
8487
/** @var \Magento\Catalog\Model\ResourceModel\Product\Collection $collection */
8588
$collection = $this->collectionFactory->create();
8689

87-
$this->collectionPreProcessor->process($collection, $searchCriteria, $attributes);
90+
$this->collectionPreProcessor->process($collection, $searchCriteria, $attributes, $context);
8891

8992
if (!$isChildSearch) {
9093
$visibilityIds = $isSearch

app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/Product/CollectionProcessor/AttributeProcessor.php

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use Magento\Catalog\Model\ResourceModel\Product\Collection;
1111
use Magento\CatalogGraphQl\Model\Resolver\Products\DataProvider\Product\CollectionProcessorInterface;
1212
use Magento\Framework\Api\SearchCriteriaInterface;
13+
use Magento\GraphQl\Model\Query\ContextInterface;
1314

1415
/**
1516
* Adds passed in attributes to product collection results
@@ -34,12 +35,20 @@ public function __construct($fieldToAttributeMap = [])
3435
}
3536

3637
/**
37-
* @inheritdoc
38+
* Process collection to add additional joins, attributes, and clauses to a product collection.
39+
*
40+
* @param Collection $collection
41+
* @param SearchCriteriaInterface $searchCriteria
42+
* @param array $attributeNames
43+
* @param ContextInterface|null $context
44+
* @return Collection
45+
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
3846
*/
3947
public function process(
4048
Collection $collection,
4149
SearchCriteriaInterface $searchCriteria,
42-
array $attributeNames
50+
array $attributeNames,
51+
ContextInterface $context = null
4352
): Collection {
4453
foreach ($attributeNames as $name) {
4554
$this->addAttribute($collection, $name);

app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/Product/CollectionProcessor/ExtensibleEntityProcessor.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
use Magento\CatalogGraphQl\Model\Resolver\Products\DataProvider\Product\CollectionProcessorInterface;
1212
use Magento\Framework\Api\SearchCriteriaInterface;
1313
use Magento\Framework\Api\ExtensionAttribute\JoinProcessorInterface;
14+
use Magento\GraphQl\Model\Query\ContextInterface;
1415

1516
/**
1617
* Add necessary joins for extensible entities.
@@ -33,16 +34,20 @@ public function __construct(JoinProcessorInterface $joinProcessor)
3334
}
3435

3536
/**
37+
* Process collection to add additional joins, attributes, and clauses to a product collection.
38+
*
3639
* @param Collection $collection
3740
* @param SearchCriteriaInterface $searchCriteria
3841
* @param array $attributeNames
42+
* @param ContextInterface|null $context
3943
* @return Collection
4044
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
4145
*/
4246
public function process(
4347
Collection $collection,
4448
SearchCriteriaInterface $searchCriteria,
45-
array $attributeNames
49+
array $attributeNames,
50+
ContextInterface $context = null
4651
): Collection {
4752
$this->joinProcessor->process($collection);
4853

app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/Product/CollectionProcessor/MediaGalleryProcessor.php

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
use Magento\CatalogGraphQl\Model\Resolver\Products\DataProvider\Product\CollectionProcessorInterface;
1212
use Magento\Framework\Api\SearchCriteriaInterface;
1313
use Magento\Catalog\Model\Product\Media\Config as MediaConfig;
14+
use Magento\GraphQl\Model\Query\ContextInterface;
1415

1516
/**
1617
* Add attributes required for every GraphQL product resolution process.
@@ -35,12 +36,20 @@ public function __construct(MediaConfig $mediaConfig)
3536
}
3637

3738
/**
38-
* @inheritdoc
39+
* Process collection to add additional joins, attributes, and clauses to a product collection.
40+
*
41+
* @param Collection $collection
42+
* @param SearchCriteriaInterface $searchCriteria
43+
* @param array $attributeNames
44+
* @param ContextInterface|null $context
45+
* @return Collection
46+
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
3947
*/
4048
public function process(
4149
Collection $collection,
4250
SearchCriteriaInterface $searchCriteria,
43-
array $attributeNames
51+
array $attributeNames,
52+
ContextInterface $context = null
4453
): Collection {
4554
if (in_array('media_gallery_entries', $attributeNames)) {
4655
$mediaAttributes = $this->mediaConfig->getMediaAttributeCodes();

app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/Product/CollectionProcessor/RequiredColumnsProcessor.php

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use Magento\Catalog\Model\ResourceModel\Product\Collection;
1111
use Magento\CatalogGraphQl\Model\Resolver\Products\DataProvider\Product\CollectionProcessorInterface;
1212
use Magento\Framework\Api\SearchCriteriaInterface;
13+
use Magento\GraphQl\Model\Query\ContextInterface;
1314

1415
/**
1516
* Add attributes required for every GraphQL product resolution process.
@@ -19,12 +20,20 @@
1920
class RequiredColumnsProcessor implements CollectionProcessorInterface
2021
{
2122
/**
22-
* {@inheritdoc}
23+
* Process collection to add additional joins, attributes, and clauses to a product collection.
24+
*
25+
* @param Collection $collection
26+
* @param SearchCriteriaInterface $searchCriteria
27+
* @param array $attributeNames
28+
* @param ContextInterface|null $context
29+
* @return Collection
30+
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
2331
*/
2432
public function process(
2533
Collection $collection,
2634
SearchCriteriaInterface $searchCriteria,
27-
array $attributeNames
35+
array $attributeNames,
36+
ContextInterface $context = null
2837
): Collection {
2938
$collection->addAttributeToSelect('special_price');
3039
$collection->addAttributeToSelect('special_price_from');

app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/Product/CollectionProcessor/SearchCriteriaProcessor.php

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
use Magento\CatalogGraphQl\Model\Resolver\Products\DataProvider\Product\CollectionProcessorInterface;
1212
use Magento\Framework\Api\SearchCriteriaInterface;
1313
use Magento\Framework\Api\SearchCriteria\CollectionProcessorInterface as SearchCriteriaApplier;
14+
use Magento\GraphQl\Model\Query\ContextInterface;
1415

1516
/**
1617
* Apply search criteria data to passed in collection.
@@ -33,12 +34,20 @@ public function __construct(SearchCriteriaApplier $searchCriteriaApplier)
3334
}
3435

3536
/**
36-
* {@inheritdoc}
37+
* Process collection to add additional joins, attributes, and clauses to a product collection.
38+
*
39+
* @param Collection $collection
40+
* @param SearchCriteriaInterface $searchCriteria
41+
* @param array $attributeNames
42+
* @param ContextInterface|null $context
43+
* @return Collection
44+
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
3745
*/
3846
public function process(
3947
Collection $collection,
4048
SearchCriteriaInterface $searchCriteria,
41-
array $attributeNames
49+
array $attributeNames,
50+
ContextInterface $context = null
4251
): Collection {
4352
$this->searchCriteriaApplier->process($searchCriteria, $collection);
4453

app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/Product/CollectionProcessor/StockProcessor.php

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
use Magento\Framework\Api\SearchCriteriaInterface;
1313
use Magento\CatalogInventory\Api\StockConfigurationInterface;
1414
use Magento\CatalogInventory\Model\ResourceModel\Stock\Status as StockStatusResource;
15+
use Magento\GraphQl\Model\Query\ContextInterface;
1516

1617
/**
1718
* Add stock filtering if configuration requires it.
@@ -41,12 +42,20 @@ public function __construct(StockConfigurationInterface $stockConfig, StockStatu
4142
}
4243

4344
/**
44-
* {@inheritdoc}
45+
* Process collection to add additional joins, attributes, and clauses to a product collection.
46+
*
47+
* @param Collection $collection
48+
* @param SearchCriteriaInterface $searchCriteria
49+
* @param array $attributeNames
50+
* @param ContextInterface|null $context
51+
* @return Collection
52+
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
4553
*/
4654
public function process(
4755
Collection $collection,
4856
SearchCriteriaInterface $searchCriteria,
49-
array $attributeNames
57+
array $attributeNames,
58+
ContextInterface $context = null
5059
): Collection {
5160
if (!$this->stockConfig->isShowOutOfStock()) {
5261
$this->stockStatusResource->addIsInStockFilterToCollection($collection);

0 commit comments

Comments
 (0)