-
Notifications
You must be signed in to change notification settings - Fork 9.4k
magento/magento2#27337: GraphQl. Add a mutation for subscribe feature #27586
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
magento/magento2#27337: GraphQl. Add a mutation for subscribe feature #27586
Conversation
Hi @atwixfirster. Thank you for your contribution
For more details, please, review the Magento Contributor Guide documentation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @atwixfirster. Thank you for the great PR. Please, check my comments below for minor changes
app/code/Magento/NewsletterGraphQl/Model/Resolver/SubscribeEmailToNewsletter.php
Outdated
Show resolved
Hide resolved
use Magento\Framework\GraphQl\Query\Resolver\ContextInterface; | ||
use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; | ||
use Magento\Framework\Validator\EmailAddress as EmailValidator; | ||
use Magento\Framework\App\Config\ScopeConfigInterface; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, sort imports alphabetically (there's "Optimize imports" feature in PHPStorm, I recommend to enable the automated sorting by default)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
I've missed that...
*/ | ||
declare(strict_types=1); | ||
|
||
namespace Magento\GraphQl\Newsletter\Guest; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, correct the namespace
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch!
fixed
...-functional/testsuite/Magento/GraphQl/Newsletter/Customer/SubscribeEmailToNewsletterTest.php
Show resolved
Hide resolved
private function getHeaderMap(string $username = '[email protected]', string $password = 'password'): array | ||
{ | ||
$customerToken = $this->customerTokenService->createCustomerAccessToken($username, $password); | ||
$headerMap = ['Authorization' => 'Bearer ' . $customerToken]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need the temp $headerMap
variable here. You may return the array
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep!
THank you, @rogyar
e974f6a
to
6b7a81f
Compare
@magento run all tests |
6b7a81f
to
319aaba
Compare
4717ec7
to
5f1330b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All comments are suggestions.
app/code/Magento/NewsletterGraphQl/Model/Resolver/SubscribeEmailToNewsletter.php
Outdated
Show resolved
Hide resolved
app/code/Magento/NewsletterGraphQl/Model/Resolver/SubscribeEmailToNewsletter.php
Outdated
Show resolved
Hide resolved
app/code/Magento/NewsletterGraphQl/Model/Resolver/SubscribeEmailToNewsletter.php
Outdated
Show resolved
Hide resolved
Now it is the most favorite part. To deal with failing tests. I believe we may decouple the resolver slightly in order to decrease the number of dependencies. |
@magento run Magento Health Index |
@magento run Magento Health Index |
Hi @rogyar, thank you for the review. |
Hi @atwixfirster, thank you for your contribution! |
Description (*)
PR fixes #27337.
This PR was mentioned for fixing failed static test related with composer.json file
#258
Related Pull Requests
https://github.com/magento/partners-magento2ee/pull/258
Fixed Issues (if relevant)
Manual testing scenarios (*)
Questions or comments
Contribution checklist (*)