Closed kisroman closed 5 years ago
Now there is no ability to throw two errors, we can only implode it in one string(as in https://github.com/magento/graphql-ce/issues/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.
addError()
Actual result: Only one last error is returned.
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 } ] } ] }
See related webonyx discussion https://github.com/webonyx/graphql-php/issues/207
Related topics: #416, #625,
AC:
todo
Now there is no ability to throw two errors, we can only implode it in one string(as in https://github.com/magento/graphql-ce/issues/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 methodaddError()
, but it returns only one.Actual result: Only one last error is returned.
Expected result: