I want to make use of the mutations but am currently running into a situation with validation and errors.
Suppose I have this object:
public class MyArgClass
{
[Required]
public string Name { get; set; }
}
And the following query:
mutation MutationName {
myArgClass(
name: ""
)
}
When I run it, I get the following response:
{
"errors": [
{
"message": "Field 'myArgClass' - The Name field is required."
}
]
}
The problem comes in when I want to determine the member name that is having the validation problem and when I want to localize the message.
I want to format the response of the errors to look like something this for language "af" as an example.
{
"errors": [
{
"Name": "Die veld is nodig."
}
]
}
And for "en":
{
"errors": [
{
"Name": "This field is required."
}
]
}
How would I go about achieving this?
I want to make use of the mutations but am currently running into a situation with validation and errors.
Suppose I have this object:
And the following query:
When I run it, I get the following response:
The problem comes in when I want to determine the member name that is having the validation problem and when I want to localize the message.
I want to format the response of the errors to look like something this for language "af" as an example.
And for "en":
How would I go about achieving this?