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

magento graphql-ce#970 Cannot return several errors for one GraphQL request #1013

Merged
merged 2 commits into from
Oct 23, 2019

Conversation

lenaorobei
Copy link
Contributor

@lenaorobei lenaorobei commented Oct 17, 2019

Example:

$e = new GraphQlInputException(__('Address validation error'));
/** @var \Magento\Framework\Phrase $error */
foreach ($errors as $error) {
    $e->addError(new GraphQlInputException(__($error)));
}
throw $e;

Copy link
Contributor

@cpartica cpartica left a comment

Choose a reason for hiding this comment

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

changes look good. It's a needed change

* @param LocalizedException $exception
* @return $this
*/
public function addError(LocalizedException $exception): self
Copy link
Contributor

Choose a reason for hiding this comment

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

I prefer an immutable type of objects. We can initialization to construct. But it's a recommendation but not a requirement.

@magento-engcom-team
Copy link
Contributor

Hi @sidolov, thank you for the review.
ENGCOM-6118 has been created to process this Pull Request
✳️ @sidolov, 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

@TomashKhamlai
Copy link
Contributor

@lenaorobei, could you provide a case where it is possible to test it? I had hopes on #961, but it is fixed now. I just wanted to verify that both data and errors arrays are present in the response body.

@ghost
Copy link

ghost commented Oct 23, 2019

Hi @lenaorobei, 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.

@okorshenko okorshenko deleted the issue-970 branch December 18, 2019 22:21
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot return several errors for one GraphQL request
6 participants