diff --git a/app/code/Magento/CustomerGraphQl/Model/Resolver/RequestPasswordResetEmail.php b/app/code/Magento/CustomerGraphQl/Model/Resolver/RequestPasswordResetEmail.php new file mode 100644 index 0000000000000..b5f5bdafe43ac --- /dev/null +++ b/app/code/Magento/CustomerGraphQl/Model/Resolver/RequestPasswordResetEmail.php @@ -0,0 +1,64 @@ +customerAccountManagement = $customerAccountManagement; + } + + /** + * @param Field $field + * @param ContextInterface $context + * @param ResolveInfo $info + * @param array|null $value + * @param array|null $args + * + * @return bool + */ + public function resolve( + Field $field, + $context, + ResolveInfo $info, + array $value = null, + array $args = null + ) { + if ($args['email']) { + try { + return $this->customerAccountManagement->initiatePasswordReset( + $args['email'], + AccountManagement::EMAIL_RESET + ); + } catch (\Exception $exception) { + return false; + } + } + } +} diff --git a/app/code/Magento/CustomerGraphQl/Model/Resolver/ResetPassword.php b/app/code/Magento/CustomerGraphQl/Model/Resolver/ResetPassword.php new file mode 100644 index 0000000000000..c10433633a526 --- /dev/null +++ b/app/code/Magento/CustomerGraphQl/Model/Resolver/ResetPassword.php @@ -0,0 +1,25 @@ +