Magento2: Input type of customizable option doesn't get returned through GraphQL

Created on 28 Jul 2020  ·  11Comments  ·  Source: magento/magento2

Preconditions

Github branches magento2/2.4-develop and architecture/master

Steps to reproduce

The GraphQL type SelectedCustomizableOption is used in multiple places across the Magento GraphQL modules to get the currently selected customizable option of a product through GraphQL. There are various field types for this such as text, textarea, select, multiselect, checkbox, etc. Currently, there's no way for a frontend using GraphQL to know how to render the SelectedCustomizableOption. Yes, the format varies according to different types, but the format is the same for input types of the same category. I believe there's no way to differentiate between a text and a textarea of SelectedCustomizableOption. Same with the different select input types.

The associated resolver class _does_ return the 'type of input' from Magento (ref: https://github.com/magento/magento2/blob/2.4-develop/app/code/Magento/QuoteGraphQl/Model/CartItem/DataProvider/CustomizableOption.php#L60), but the associated GraphQL schema does not define a field for the same (ref: https://github.com/magento/magento2/blob/2.4-develop/app/code/Magento/QuoteGraphQl/etc/schema.graphqls#L346) and hence the 'type of input' doesn't get returned.

Upon some searching, the GraphQL coverage docs did have the 'type of input' as a field in SelectedCustomizableOption a couple of months ago (ref: https://github.com/magento/architecture/blob/673438109bbf63d819e96c373ef7622206ff7f9b/design-documents/graph-ql/coverage/add-items-to-cart/AddSimpleProductToCart.graphqls#L59) until the new coverage docs (ref: https://github.com/magento/architecture/blob/master/design-documents/graph-ql/coverage/Cart.graphqls#L114) was matched according to the current GraphQL schema and was thus, removed.

Expected result

Consistency.

Is the field type required to render the input type on the frontend?

  • If yes, we need to add the field back to the schema.
  • If not, we need to remove it from the resolver for consistency and to avoid confusion for developers in the future.

Actual result

The field type was removed from the QuoteGraphQl module in this commit: https://github.com/magento/magento2/commit/1315577e2099637207f02deec48607d81f7cde46#diff-795a33fde881f18aba5165a5a8c7513fL317 and from the architecture coverage docs a couple months ago and now the code is inconsistent and causes confusion for developers.


Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.

  • [ ] Severity: S0 _- Affects critical data or functionality and leaves users without workaround._
  • [ ] Severity: S1 _- Affects critical data or functionality and forces users to employ a workaround._
  • [x] Severity: S2 _- Affects non-critical data or functionality and forces users to employ a workaround._
  • [ ] Severity: S3 _- Affects non-critical data or functionality and does not force users to employ a workaround._
  • [ ] Severity: S4 _- Affects aesthetics, professional look and feel, “quality” or “usability”._
QuoteGraphQl Fixed in 2.4.x Format is valid P1 done GraphQL

All 11 comments

Hi @drpayyne. Thank you for your report.
To help us process this issue please make sure that you provided the following information:

  • Summary of the issue
  • Information on your environment
  • Steps to reproduce
  • Expected and actual results

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento give me 2.4-develop instance - upcoming 2.4.x release

For more details, please, review the Magento Contributor Assistant documentation.

Please, add a comment to assign the issue: @magento I am working on this


  • Join Magento Community Engineering Slack and ask your questions in #github channel.

    :warning: According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.

:clock10: You can find the schedule on the Magento Community Calendar page.

:telephone_receiver: The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket.

:movie_camera: You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel

:pencil2: Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

Hi @nrkapoor. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:


    1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
      DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.

    1. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.
    1. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

    1. Verify that the issue is reproducible on 2.4-develop branch
      Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
      - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
      - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and _stop verification process here_!


Hi @munkhulzii. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:


    1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
      DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.

    1. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.
    1. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

    1. Verify that the issue is reproducible on 2.4-develop branch
      Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
      - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
      - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and _stop verification process here_!


@nrkapoor For me, no clear definition of the expected result was given here. Consistency yes, but should I remove the field or add it everywhere?

@magento I am working on this

Hi @dineshvb! :wave:
Thank you for collaboration. Only members of Community Contributors Team are allowed to be assigned to the issue. Please use @magento add to contributors team command to join Contributors team.

@magento add to contributors team

Hi @dineshvb! :wave:
Thank you for joining. Please accept team invitation :point_right: here :point_left: and add your comment one more time.

@magento I am working on this

Hi @drpayyne, @dineshvb.

Thank you for your report and collaboration!

The related internal Jira ticket MC-37414 was closed as Fixed.

The fix will be available with the upcoming 2.4.3 release.

Hi @magento-engcom-team, why was neither the PR, nor the issue updated with the existence and the status of an internal issue and PR? This is counterproductive of having an open source repository... almost two months of the linked PR work is useless now?

Was this page helpful?
0 / 5 - 0 ratings