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

Cannot return several errors for one GraphQL request #970

Closed
kisroman opened this issue Sep 27, 2019 · 3 comments · Fixed by #1013
Closed

Cannot return several errors for one GraphQL request #970

kisroman opened this issue Sep 27, 2019 · 3 comments · Fixed by #1013
Assignees
Labels
Award: complex bug Something isn't working framework

Comments

@kisroman
Copy link
Contributor

kisroman commented Sep 27, 2019

Now there is no ability to throw two errors, we can only implode it in one string(as in #961 in method getAddressErrors()).

If you create exception GraphQlInputException it has method addError(), so you can add additional errors, but it doesn't work.See screenshot, I added two errors with method addError(), but it returns only one.

Actual result:
Only one last error is returned.
Screen Shot 2019-09-27 at 13 42 29

Expected result:

{
  "errors": [
    {
      "message": "First error.",
      "extensions": {
        "category": "graphql"
      },
      "locations": [
        {
          "line": 2,
          "column": 3
        }
      ]
    },
    {
      "message": "Second error.",
      "extensions": {
        "category": "graphql"
      },
      "locations": [
        {
          "line": 2,
          "column": 3
        }
      ]
    }
  ]
}
@lenaorobei
Copy link
Contributor

See related webonyx discussion webonyx/graphql-php#207

@TomashKhamlai
Copy link
Contributor

Related topics: #416, #625,

@lenaorobei
Copy link
Contributor

AC:

  • all todo with reference to this issue are fixed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Award: complex bug Something isn't working framework
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants