Skip to content
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

Improve model validation error for GraphQL #101

Closed
vincent-pochet opened this issue Apr 25, 2022 · 0 comments · Fixed by #102
Closed

Improve model validation error for GraphQL #101

vincent-pochet opened this issue Apr 25, 2022 · 0 comments · Fixed by #102
Assignees
Labels
Feature Add a new feature to the app GraphQL Related to the GraphQL API

Comments

@vincent-pochet
Copy link
Collaborator

For GraphQL mutation, we should improve the way validation errors are sent to the front.

It will allow the front end to properly handle translations and field errors

In order to do to so, in case of unprocessable_entity error, an extension property of the GraphQL error will give the full detail of what went wrong when processing the mutation on the model.

Example of payload:

{
  "customer_id": ["already_taken"],
  "country": ["invalid"]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Add a new feature to the app GraphQL Related to the GraphQL API
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant