Skip to content

magento/magento2#: GraphQl. Remove a redundant logic in “SetShippingMethodsOnCart” mutation resolver #27349

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

atwixfirster
Copy link
Contributor

@atwixfirster atwixfirster commented Mar 19, 2020

Description (*)

PR removes a redundant logic in the SetShippingMethodsOnCart mutation resolver because Webonix covers the next cases:

  • shipping_methods.carrier_code does not exist

27349_01

  • shipping_methods.method_code does not exist

27349_02

Related Pull Requests

Fixed Issues (if relevant)

  1. magento/magento2#<issue_number>: Issue title

Manual testing scenarios (*)

  1. ...
  2. ...

Questions or comments

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)

Resolved issues:

  1. resolves [Issue] magento/magento2#: GraphQl. Remove a redundant logic in “SetShippingMethodsOnCart” mutation resolver #28262: magento/magento2#: GraphQl. Remove a redundant logic in “SetShippingMethodsOnCart” mutation resolver

Resolved issues:

  1. resolves [Issue] magento/magento2#: GraphQl. Remove a redundant logic in “SetShippingMethodsOnCart” mutation resolver #28427: magento/magento2#: GraphQl. Remove a redundant logic in “SetShippingMethodsOnCart” mutation resolver

@m2-assistant
Copy link

m2-assistant bot commented Mar 19, 2020

Hi @atwixfirster. 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

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

@magento-engcom-team magento-engcom-team added Component: QuoteGraphQl Release Line: 2.4 Partner: Atwix Pull Request is created by partner Atwix partners-contribution Pull Request is created by Magento Partner labels Mar 19, 2020
@rogyar rogyar self-assigned this Mar 19, 2020
@atwixfirster
Copy link
Contributor Author

@rogyar , could you please review this PR because failed static tests are not tie to the provided changes.

Thank you!

@rogyar rogyar added the Auto-Tests: Not Required Changes in Pull Request does not require coverage by auto-tests label Mar 27, 2020
@magento-engcom-team
Copy link
Contributor

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

@engcom-Alfa
Copy link
Contributor

✔️ QA Passed

After:

Case 1

method_code doesn't exist

Request:

mutation {
setShippingMethodsOnCart(input: {
  cart_id: "IIHXzIYP2HelB7xerWpZN1h4EZU7wxk4"
  shipping_methods:
  [
    {
      carrier_code: "ups"
    }
  ]
}) {
  cart {
    shipping_addresses {
      selected_shipping_method {
        carrier_code
        method_code
        carrier_title
        method_title
      }
    }
  }
}
}

Response:

{
  "errors": [
    {
      "message": "Field ShippingMethodInput.method_code of required type String! was not provided.",
      "extensions": {
        "category": "graphql"
      },
      "locations": [
        {
          "line": 2,
          "column": 100
        }
      ]
    }
  ]
}

Case 2

carrier_code doesn't exist

Request:

mutation {
setShippingMethodsOnCart(input: {
  cart_id: "IIHXzIYP2HelB7xerWpZN1h4EZU7wxk4"
  shipping_methods:
  [
    {
      method_code: "GND"

    }
  ]
}) {
  cart {
    shipping_addresses {
      selected_shipping_method {
        carrier_code
        method_code
        carrier_title
        method_title
      }
    }
  }
}
}

Response:

{
  "errors": [
    {
      "message": "Field ShippingMethodInput.carrier_code of required type String! was not provided.",
      "extensions": {
        "category": "graphql"
      },
      "locations": [
        {
          "line": 2,
          "column": 100
        }
      ]
    }
  ]
}

@engcom-Charlie engcom-Charlie self-assigned this May 18, 2020
@engcom-Charlie engcom-Charlie added Auto-Tests: Covered All changes in Pull Request is covered by auto-tests and removed Auto-Tests: Not Required Changes in Pull Request does not require coverage by auto-tests labels May 18, 2020
@slavvka
Copy link
Member

slavvka commented May 18, 2020

@magento create issue

@slavvka slavvka added the Priority: P3 May be fixed according to the position in the backlog. label May 19, 2020
@magento-engcom-team
Copy link
Contributor

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

@VladimirZaets
Copy link
Contributor

@magento create issue

@VladimirZaets VladimirZaets added QA: Added to Regression Scope Scenario was analysed and added to Regression Testing Scope and removed QA: Ready to add to Regression Scope Should be analyzed and added to Regression Testing Scope(if applicable) labels May 29, 2020
@nrkapoor nrkapoor requested a review from danielrenaud June 11, 2020 13:06
@avattam06
Copy link
Contributor

@magento run all tests

@avattam06
Copy link
Contributor

@magento run all tests

@avattam06
Copy link
Contributor

@magento run integration tests

@avattam06
Copy link
Contributor

@magento run all tests

magento-engcom-team pushed a commit that referenced this pull request Jun 27, 2020
…“SetShippingMethodsOnCart” mutation resolver #27349
@magento-engcom-team magento-engcom-team merged commit c81648d into magento:2.4-develop Jun 27, 2020
@m2-assistant
Copy link

m2-assistant bot commented Jun 27, 2020

Hi @atwixfirster, 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 Component: QuoteGraphQl Partner: Atwix Pull Request is created by partner Atwix partners-contribution Pull Request is created by Magento Partner Priority: P3 May be fixed according to the position in the backlog. Progress: accept Project: GraphQL QA: Added to Regression Scope Scenario was analysed and added to Regression Testing Scope Release Line: 2.4 Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround.
Projects
Archived in project
9 participants