Skip to content
This repository has been archived by the owner on Dec 19, 2019. It is now read-only.

graphql-input provides to Customer as many errors as appeared instead of last one like on Magento Storefront #416

Closed
TomashKhamlai opened this issue Feb 28, 2019 · 3 comments
Assignees
Labels
Archived bug Something isn't working Checkout Component: QuoteGraphQl Contribution Day Tickets is good for start on Contribution Day Fixed in 2.3.x good first issue Good for newcomers

Comments

@TomashKhamlai
Copy link
Contributor

Preconditions (*)

  1. Any supported product with more then 1 required customizable options

Steps to reproduce (*)

  1. Add product to cart without providing options

Expected result (*)

  1. Screenshot:
    image

  2. GraphQL:

{
  "errors": [
    {
      "message": "The product's required option(s) weren't entered.
Make sure the options are entered and try again.",
      "category": "graphql-input",
      "locations": [
        {
          "line": 2,
          "column": 3
        }
      ],
      "path": [
        "addSimpleProductsToCart"
      ]
    }
  ],
  "data": {
    "addSimpleProductsToCart": null
  }
}

Actual result (*)

  1. GraphQL:
{
  "errors": [
    {
      "message": "The product's required option(s) weren't entered.
Make sure the options are entered and try again.\n
The product's required option(s) weren't entered.
Make sure the options are entered and try again.",
      "category": "graphql-input",
      "locations": [
        {
          "line": 2,
          "column": 3
        }
      ],
      "path": [
        "addSimpleProductsToCart"
      ]
    }
  ],
  "data": {
    "addSimpleProductsToCart": null
  }
}

If it is the feature then it's worth to document the benefits of such behaviour with usage example. Guidelines or devdocs are good places for this.

@lenaorobei
Copy link
Contributor

Please use #421 as a reference. Need to rework the PR and use Magento\Framework\Exception\AggregateExceptionInterface for this implementation.

@paul-stolk-webdiensten
Copy link
Contributor

@magento I am working on it

@magento-engcom-team
Copy link
Contributor

Hi @TomashKhamlai. Thank you for your report.
The issue has been fixed in #1023 by @paul-stolk-webdiensten in 2.3-develop branch
Related commit(s):

The fix will be available with the upcoming 2.3.5 release.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Archived bug Something isn't working Checkout Component: QuoteGraphQl Contribution Day Tickets is good for start on Contribution Day Fixed in 2.3.x good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

7 participants