Title: Localized Validation with Member Names. · Issue #313 · EntityGraphQL/EntityGraphQL · GitHub
Open Graph Title: Localized Validation with Member Names. · Issue #313 · EntityGraphQL/EntityGraphQL
X Title: Localized Validation with Member Names. · Issue #313 · EntityGraphQL/EntityGraphQL
Description: 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: mutati...
Open Graph Description: 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; ...
X Description: 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; ...
Opengraph URL: https://github.com/EntityGraphQL/EntityGraphQL/issues/313
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Localized Validation with Member Names.","articleBody":"I want to make use of the mutations but am currently running into a situation with validation and errors.\r\nSuppose I have this object:\r\n```\r\npublic class MyArgClass\r\n{\r\n [Required]\r\n public string Name { get; set; }\r\n}\r\n```\r\n\r\nAnd the following query:\r\n```\r\nmutation MutationName {\r\n myArgClass(\r\n name: \"\"\r\n )\r\n}\r\n```\r\n\r\nWhen I run it, I get the following response:\r\n```\r\n{\r\n \"errors\": [\r\n {\r\n \"message\": \"Field 'myArgClass' - The Name field is required.\"\r\n }\r\n ]\r\n}\r\n```\r\n\r\nThe 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.\r\n\r\nI want to format the response of the errors to look like something this for language \"af\" as an example.\r\n```\r\n{\r\n \"errors\": [\r\n {\r\n \"Name\": \"Die veld is nodig.\"\r\n }\r\n ]\r\n}\r\n```\r\n\r\nAnd for \"en\":\r\n\r\n```\r\n{\r\n \"errors\": [\r\n {\r\n \"Name\": \"This field is required.\"\r\n }\r\n ]\r\n}\r\n```\r\n\r\nHow would I go about achieving this?","author":{"url":"https://github.com/willemtoerien","@type":"Person","name":"willemtoerien"},"datePublished":"2023-08-09T06:29:33.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/313/EntityGraphQL/issues/313"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:e8c1030c-1f71-9e60-541a-7c23ee2038fc |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | EDF4:32EBB1:9E9CA0:E1DCCB:6978C3E1 |
| html-safe-nonce | 36770a93289fa255c9511e3fddef4d2e3057422c536af27e65cf3ac56ca5dece |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFREY0OjMyRUJCMTo5RTlDQTA6RTFEQ0NCOjY5NzhDM0UxIiwidmlzaXRvcl9pZCI6IjEyOTA3MjYxODA2MDg1OTA4MTciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | f2c7cd5544ee1502fd1e031a46ced43965c5749c86ad614bd0f6109fddedbefb |
| hovercard-subject-tag | issue:1842577023 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/EntityGraphQL/EntityGraphQL/313/issue_layout |
| twitter:image | https://opengraph.githubassets.com/3bf0fdcc7dc5516b52c469dcb1bc5e5f6862c3a95d42c64c4bbac00068c060aa/EntityGraphQL/EntityGraphQL/issues/313 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/3bf0fdcc7dc5516b52c469dcb1bc5e5f6862c3a95d42c64c4bbac00068c060aa/EntityGraphQL/EntityGraphQL/issues/313 |
| og:image:alt | 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; ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | willemtoerien |
| hostname | github.com |
| expected-hostname | github.com |
| None | 2981c597c945c1d90ac6fa355ce7929b2f413dfe7872ca5c435ee53a24a1de50 |
| turbo-cache-control | no-preview |
| go-import | github.com/EntityGraphQL/EntityGraphQL git https://github.com/EntityGraphQL/EntityGraphQL.git |
| octolytics-dimension-user_id | 87887288 |
| octolytics-dimension-user_login | EntityGraphQL |
| octolytics-dimension-repository_id | 38514759 |
| octolytics-dimension-repository_nwo | EntityGraphQL/EntityGraphQL |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 38514759 |
| octolytics-dimension-repository_network_root_nwo | EntityGraphQL/EntityGraphQL |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 9520342ca7ead2f1a011aa96eaff82fc054a4970 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width