Skip to content

Drop GraphQL package requirements from reCAPTCHA endpoint config providers - #349

Open
lbajsarowicz wants to merge 1 commit into
magento:developfrom
lbajsarowicz:fix/41558-webapi-config-provider-graphql-deps
Open

lbajsarowicz wants to merge 1 commit into
magento:developfrom
lbajsarowicz:fix/41558-webapi-config-provider-graphql-deps

Conversation

@lbajsarowicz

Copy link
Copy Markdown

Description

magento/module-re-captcha-contact requires magento/module-contact-graph-ql and magento/module-re-captcha-resend-confirmation-email requires magento/module-customer-graph-ql. The only use of those packages is a SomeResolver::class constant compared against EndpointInterface::getServiceClass(), which is a string. Magento\ReCaptchaCustomer\Model\WebapiConfigProvider references four Magento\CustomerGraphQl\Model\Resolver\* classes the same way, without declaring the dependency at all.

This PR replaces the ::class references with private string constants holding the same fully qualified names and removes the two GraphQL requirements from composer.json. The compared values are byte-for-byte identical, so endpoint matching for REST and GraphQL requests does not change; the modules stop pulling GraphQL packages into a build that does not need them.

Related Pull Requests / Issues

Part of magento/magento2#41558. A companion PR in this repository decouples the reCAPTCHA type modules from Magento_ReCaptchaWebapiGraphQl.

Manual testing scenarios

  1. Install with all *-graph-ql packages removed through replace in the root composer.json; the three modules install and setup:di:compile succeeds.
  2. Standard install with GraphQL: enable reCAPTCHA for the contact form, send the contactUs mutation without a token; the request is rejected with the reCAPTCHA error exactly as on develop. Repeat for resendConfirmationEmail, changeCustomerPassword, requestPasswordResetEmail, resetPassword, updateCustomerV2, generateCustomerToken and createCustomerV2.

Verification

PHPCS (Magento2 standard) on the changed PHP files: 0 errors, 0 warnings. check_copyright_pr.php: all files pass.

Contribution checklist

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds are green)

…iders

Compare webapi endpoints against resolver class names as string constants
instead of importing the GraphQL resolver classes, and remove the
module-contact-graph-ql and module-customer-graph-ql requirements. magento/magento2#41558
@lbajsarowicz

Copy link
Copy Markdown
Author

@magento run all tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant