Skip to content

Commit 639eabd

Browse files
LYNX-195: Change ProductInterface custom_attributes to custom_attributesV2
1 parent 9bc508b commit 639eabd

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

app/code/Magento/CatalogGraphQl/etc/schema.graphqls

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ interface ProductInterface @typeResolver(class: "Magento\\CatalogGraphQl\\Model\
125125
categories: [CategoryInterface] @doc(description: "The categories assigned to a product.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Categories") @cache(cacheIdentity: "Magento\\CatalogGraphQl\\Model\\Resolver\\Category\\CategoriesIdentity")
126126
canonical_url: String @doc(description: "The relative canonical URL. This value is returned only if the system setting 'Use Canonical Link Meta Tag For Products' is enabled.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\CanonicalUrl")
127127
media_gallery: [MediaGalleryInterface] @doc(description: "An array of media gallery objects.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\MediaGallery")
128-
custom_attributes(filters: AttributeFilterInput): ProductCustomAttributes @doc(description: "Product custom attributes.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\ProductCustomAttributes")
128+
custom_attributesV2(filters: AttributeFilterInput): ProductCustomAttributes @doc(description: "Product custom attributes.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\ProductCustomAttributes")
129129
}
130130

131131
interface PhysicalProductInterface @typeResolver(class: "Magento\\CatalogGraphQl\\Model\\ProductInterfaceTypeResolverComposite") @doc(description: "Contains attributes specific to tangible products.") {

dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/GetProductWithCustomAttributesTest.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ public function testGetProductWithCustomAttributes()
147147
{
148148
sku
149149
name
150-
custom_attributes {
150+
custom_attributesV2 {
151151
items {
152152
code
153153
... on AttributeValue {
@@ -173,7 +173,7 @@ public function testGetProductWithCustomAttributes()
173173
$response = $this->graphQlQuery($query);
174174

175175
$this->assertProductCustomAttributesResult($response);
176-
$this->assertEmpty(count($response['products']['items'][0]['custom_attributes']['errors']));
176+
$this->assertEmpty(count($response['products']['items'][0]['custom_attributesV2']['errors']));
177177
}
178178

179179
public function testGetNoResultsWhenFilteringByNotExistingSku()
@@ -186,7 +186,7 @@ public function testGetNoResultsWhenFilteringByNotExistingSku()
186186
{
187187
sku
188188
name
189-
custom_attributes {
189+
custom_attributesV2 {
190190
items {
191191
code
192192
... on AttributeValue {
@@ -222,7 +222,7 @@ public function testGetProductCustomAttributesFiltered()
222222
{
223223
sku
224224
name
225-
custom_attributes(filters: {is_visible_on_front: true}) {
225+
custom_attributesV2(filters: {is_visible_on_front: true}) {
226226
items {
227227
code
228228
... on AttributeValue {
@@ -253,7 +253,7 @@ public function testGetProductCustomAttributesFiltered()
253253
0 => [
254254
'sku' => $this->product->getSku(),
255255
'name' => $this->product->getName(),
256-
'custom_attributes' => [
256+
'custom_attributesV2' => [
257257
'items' => [
258258
0 => [
259259
'code' => $this->varcharCustomAttribute->getAttributeCode(),
@@ -284,7 +284,7 @@ public function testGetProductCustomAttributesFilteredByNotExistingField()
284284
{
285285
sku
286286
name
287-
custom_attributes(filters: {not_existing_filter: true}) {
287+
custom_attributesV2(filters: {not_existing_filter: true}) {
288288
items {
289289
code
290290
... on AttributeValue {
@@ -330,10 +330,10 @@ private function assertProductCustomAttributesResult(array $response): void
330330
$this->assertArrayHasKey('items', $response['products'], 'Query result does not contain products');
331331
$this->assertArrayHasKey(
332332
'items',
333-
$response['products']['items'][0]['custom_attributes'],
333+
$response['products']['items'][0]['custom_attributesV2'],
334334
'Query result does not contain custom attributes'
335335
);
336-
$this->assertGreaterThanOrEqual(2, count($response['products']['items'][0]['custom_attributes']['items']));
336+
$this->assertGreaterThanOrEqual(2, count($response['products']['items'][0]['custom_attributesV2']['items']));
337337

338338
$this->assertResponseFields(
339339
$response['products']['items'][0],
@@ -345,7 +345,7 @@ private function assertProductCustomAttributesResult(array $response): void
345345

346346
$this->assertResponseFields(
347347
$this->getAttributeByCode(
348-
$response['products']['items'][0]['custom_attributes']['items'],
348+
$response['products']['items'][0]['custom_attributesV2']['items'],
349349
$this->varcharCustomAttribute->getAttributeCode()
350350
),
351351
[
@@ -356,7 +356,7 @@ private function assertProductCustomAttributesResult(array $response): void
356356

357357
$this->assertResponseFields(
358358
$this->getAttributeByCode(
359-
$response['products']['items'][0]['custom_attributes']['items'],
359+
$response['products']['items'][0]['custom_attributesV2']['items'],
360360
$this->multiselectCustomAttribute->getAttributeCode()
361361
),
362362
[

0 commit comments

Comments
 (0)