Skip to content

Issue-29302- Graphql schema change #30615

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

Conversation

dineshvb
Copy link

@dineshvb dineshvb commented Oct 23, 2020

Description (*)

  • Added the "type" field in the schema of QuoteGraphQl's "SelectedCustomizableOption" type.
  • This field is used to maintain consistency between the Resolver class and Graphql schema.
  • Also, the type field returns the input types like Checkbox, Radio Button, etc., which helps the frontend developers to render the PDP page if required.

Fixed Issues (if relevant)

  1. Fixes Input type of customizable option doesn't get returned through GraphQL #29302

Manual testing scenarios (*)

  1. ... Added a few customizable options to a few products in local admin and checked it via Altair GraphQL client

Sample Request :

{
  cart(cart_id: String!)
  {
    items
    {
      id
      quantity
      product{
        name
      }
      ... on SimpleCartItem{
       alias1: customizable_options{
          id
          is_required
          label
          sort_order
          type
        }
      }
      
      ... on DownloadableCartItem{
      alias2: customizable_options{
          id
          is_required
          label
          sort_order
          type
         
        }
      }
    }
  }
}

Sample Response:

{
  "data": {
    "cart": {
      "items": [
        {
          "id": "7",
          "quantity": 1,
          "product": {
            "name": "paint"
          },
          "alias1": [
            {
              "id": 1,
              "is_required": true,
              "label": "size",
              "sort_order": 1,
              "type": "checkbox"
            }
          ]
        },
        {
          "id": "12",
          "quantity": 1,
          "product": {
            "name": "Music CDs"
          },
          "alias2": [
            {
              "id": 3,
              "is_required": true,
              "label": "track",
              "sort_order": 1,
              "type": "radio"
            }
          ]
        },
        {
          "id": "13",
          "quantity": 2,
          "product": {
            "name": "paint"
          },
          "alias1": [
            {
              "id": 1,
              "is_required": true,
              "label": "size",
              "sort_order": 1,
              "type": "checkbox"
            }
          ]
        }
      ]
    }
  }
}

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)

- Added the type field in the schema of QuoteGraphQl's SelectedCustomizableOption type
@m2-assistant
Copy link

m2-assistant bot commented Oct 23, 2020

Hi @dineshvb. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento give me test instance - deploy test instance based on PR changes
  • @magento give me 2.4-develop instance - deploy vanilla Magento instance

❗ Automated tests can be triggered manually with an appropriate comment:

  • @magento run all tests - run or re-run all required tests against the PR changes
  • @magento run <test-build(s)> - run or re-run specific test build(s)
    For example: @magento run Unit Tests

<test-build(s)> is a comma-separated list of build names. Allowed build names are:

  1. Database Compare
  2. Functional Tests CE
  3. Functional Tests EE,
  4. Functional Tests B2B
  5. Integration Tests
  6. Magento Health Index
  7. Sample Data Tests CE
  8. Sample Data Tests EE
  9. Sample Data Tests B2B
  10. Static Tests
  11. Unit Tests
  12. WebAPI Tests

You can find more information about the builds here

ℹ️ Please run only needed test builds instead of all when developing. Please run all test builds before sending your PR for review.

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

⚠️ According to the Magento Contribution requirements, all Pull Requests must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.

🕙 You can find the schedule on the Magento Community Calendar page.

📞 The triage of Pull Requests 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.

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

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

@swnsma
Copy link
Contributor

swnsma commented Oct 23, 2020

Hi @dineshvb,
Could you sign Adobe CLA before we can proceed with reviewing your Pull Request?

@swnsma swnsma self-requested a review October 23, 2020 10:54
@swnsma swnsma self-assigned this Oct 23, 2020
@nrkapoor
Copy link

@magento run all tests

@dineshvb
Copy link
Author

@swnsma Since there were a few existing static failures with the schema, how should I proceed? Thank you

@dineshvb
Copy link
Author

@swnsma Can you please look through the static tests that were failing?

@dineshvb
Copy link
Author

@keharper Since there were a few existing static failures with the schema, how should I proceed? Thank you

@swnsma
Copy link
Contributor

swnsma commented Nov 13, 2020

Hi @dineshvb,
Sorry for long response.

Hi @sidolov,
What it the better approach in such situation?
I believe that changing names of already available fields will cause a BC break.

@keharper
Copy link
Contributor

@dineshvb I'm just the documentation guy, so I can't really help with this. All I can say is please open a devdocs PR if your changes are merged.

@sidolov
Copy link
Contributor

sidolov commented Nov 13, 2020

@dineshvb , @swnsma I think we should proceed with changes since the fields already exist in schema

Copy link
Contributor

@swnsma swnsma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Failed tests approved.
Current violations do not related to current PR.
Moreover, fix of violations will introduce BC break.

@magento-engcom-team
Copy link
Contributor

Hi @swnsma, thank you for the review.
ENGCOM-8463 has been created to process this Pull Request
✳️ @swnsma, could you please add one of the following labels to the Pull Request?

Label Description
Auto-Tests: Covered All changes in Pull Request is covered by auto-tests
Auto-Tests: Not Covered Changes in Pull Request requires coverage by auto-tests
Auto-Tests: Not Required Changes in Pull Request does not require coverage by auto-tests

@dineshvb
Copy link
Author

Hi @swnsma, thank you for the review.
ENGCOM-8463 has been created to process this Pull Request
@swnsma, could you please add one of the following labels to the Pull Request?

Label Description
Auto-Tests: Covered All changes in Pull Request is covered by auto-tests
Auto-Tests: Not Covered Changes in Pull Request requires coverage by auto-tests
Auto-Tests: Not Required Changes in Pull Request does not require coverage by auto-tests

@swnsma can you add a label to this?

@swnsma swnsma added the Auto-Tests: Not Covered Changes in Pull Request requires coverage by auto-tests label Nov 18, 2020
@swnsma
Copy link
Contributor

swnsma commented Dec 4, 2020

Hi @dineshvb,
It looks like you have commited your Magento Commerce symlinks.
Could you reset these changes?

@dineshvb
Copy link
Author

dineshvb commented Dec 4, 2020

@magento run all tests

@dineshvb
Copy link
Author

dineshvb commented Dec 7, 2020

@magento run all tests

@dineshvb dineshvb requested review from swnsma and cpartica December 7, 2020 13:04
@dineshvb
Copy link
Author

dineshvb commented Dec 7, 2020

The test failures here are not related to my changes which come under the WEB API graphql tests that were successful

@swnsma
Copy link
Contributor

swnsma commented Dec 7, 2020

@magento run Functional Tests B2B, Functional Tests CE, Functional Tests EE

@swnsma
Copy link
Contributor

swnsma commented Dec 9, 2020

@magento run Functional Tests B2B, Functional Tests EE

2 similar comments
@dineshvb
Copy link
Author

@magento run Functional Tests B2B, Functional Tests EE

@swnsma
Copy link
Contributor

swnsma commented Dec 11, 2020

@magento run Functional Tests B2B, Functional Tests EE

@swnsma swnsma added Auto-Tests: Covered All changes in Pull Request is covered by auto-tests and removed Auto-Tests: Not Covered Changes in Pull Request requires coverage by auto-tests labels Dec 11, 2020
@swnsma
Copy link
Contributor

swnsma commented Dec 31, 2020

@magento run Functional Tests B2B, Functional Tests EE

@dineshvb
Copy link
Author

dineshvb commented Jan 6, 2021

@magento run Functional Tests B2B

@magento-engcom-team
Copy link
Contributor

Hi @swnsma, thank you for the review.
ENGCOM-8463 has been created to process this Pull Request

@magento-engcom-team magento-engcom-team merged commit a2c5e93 into magento:2.4-develop Feb 9, 2021
@m2-assistant
Copy link

m2-assistant bot commented Feb 9, 2021

Hi @dineshvb, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Tests: Covered All changes in Pull Request is covered by auto-tests Award: bug fix Award: test coverage Component: QuoteGraphQl Partner: EY partners-contribution Pull Request is created by Magento Partner Priority: P1 Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing. Progress: ready for testing Project: GraphQL Release Line: 2.4
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Input type of customizable option doesn't get returned through GraphQL
7 participants