Skip to content

Commit 47bb5f4

Browse files
committed
AC-9147::Newsletter subscription flag for customer graphql type is in the wrong module
1 parent 59b2921 commit 47bb5f4

File tree

7 files changed

+23
-8
lines changed

7 files changed

+23
-8
lines changed

app/code/Magento/CustomerGraphQl/etc/di.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@
3030
<item name="Magento\Customer\Model\Address" xsi:type="object">
3131
Magento\CustomerGraphQl\Model\Resolver\Cache\Customer\Address\TagsStrategy
3232
</item>
33-
<item name="Magento\Newsletter\Model\Subscriber" xsi:type="object">
34-
Magento\CustomerGraphQl\Model\Resolver\Cache\Subscriber\TagsStrategy
35-
</item>
3633
</argument>
3734
</arguments>
3835
</type>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ type Customer @doc(description: "Defines the customer name, addresses, and other
136136
date_of_birth: String @doc(description: "The customer's date of birth.")
137137
taxvat: String @doc(description: "The customer's Value-added tax (VAT) number (for corporate customers).")
138138
id: Int @doc(description: "The ID assigned to the customer.") @deprecated(reason: "`id` is not needed as part of `Customer`, because on the server side, it can be identified based on the customer token used for authentication. There is no need to know customer ID on the client side.")
139-
is_subscribed: Boolean @doc(description: "Indicates whether the customer is subscribed to the company's newsletter.") @resolver(class: "\\Magento\\CustomerGraphQl\\Model\\Resolver\\IsSubscribed")
139+
is_subscribed: Boolean @doc(description: "Indicates whether the customer is subscribed to the company's newsletter.") @resolver(class: "\\Magento\\NewsletterGraphQl\\Model\\Resolver\\IsSubscribed")
140140
addresses: [CustomerAddress] @doc(description: "An array containing the customer's shipping and billing addresses.") @resolver(class: "\\Magento\\CustomerGraphQl\\Model\\Resolver\\CustomerAddresses")
141141
gender: Int @doc(description: "The customer's gender (Male - 1, Female - 2).")
142142
custom_attributes(attributeCodes: [ID!]): [AttributeValueInterface] @doc(description: "Customer's custom attributes.") @resolver(class: "Magento\\CustomerGraphQl\\Model\\Resolver\\CustomAttributeFilter")

app/code/Magento/CustomerGraphQl/Model/Resolver/Cache/Subscriber/TagsStrategy.php renamed to app/code/Magento/NewsletterGraphQl/Model/Resolver/Cache/Subscriber/TagsStrategy.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66
declare(strict_types=1);
77

8-
namespace Magento\CustomerGraphQl\Model\Resolver\Cache\Subscriber;
8+
namespace Magento\NewsletterGraphQl\Model\Resolver\Cache\Subscriber;
99

1010
use Magento\Customer\Model\Customer;
1111
use Magento\Framework\App\Cache\Tag\StrategyInterface;

app/code/Magento/CustomerGraphQl/Model/Resolver/IsSubscribed.php renamed to app/code/Magento/NewsletterGraphQl/Model/Resolver/IsSubscribed.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66
declare(strict_types=1);
77

8-
namespace Magento\CustomerGraphQl\Model\Resolver;
8+
namespace Magento\NewsletterGraphQl\Model\Resolver;
99

1010
use Magento\Customer\Api\Data\CustomerInterface;
1111
use Magento\Framework\App\ObjectManager;

app/code/Magento/CustomerGraphQl/Test/Unit/Model/Resolver/IsSubscribedTest.php renamed to app/code/Magento/NewsletterGraphQl/Test/Unit/Model/Resolver/IsSubscribedTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66

77
declare(strict_types=1);
88

9-
namespace Magento\CustomerGraphQl\Test\Unit\Model\Resolver;
9+
namespace Magento\NewsletterGraphQl\Test\Unit\Model\Resolver;
1010

1111
use Magento\Customer\Api\Data\CustomerInterface;
12-
use Magento\CustomerGraphQl\Model\Resolver\IsSubscribed;
12+
use Magento\NewsletterGraphQl\Model\Resolver\IsSubscribed;
1313
use Magento\Framework\GraphQl\Config\Element\Field;
1414
use Magento\Framework\GraphQl\Schema\Type\ResolveInfo;
1515
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
9+
<type name="Magento\Framework\App\Cache\Tag\Strategy\Factory">
10+
<arguments>
11+
<argument>
12+
<item name="Magento\Newsletter\Model\Subscriber" xsi:type="object">
13+
Magento\NewsletterGraphQl\Model\Resolver\Cache\Subscriber\TagsStrategy
14+
</item>
15+
</argument>
16+
</arguments>
17+
</type>
18+
</config>

0 commit comments

Comments
 (0)