title: Is it possible to accessing GraphQL validation errors from a Relay mutation?
body: <p>I'm somewhat new to GraphQL, so, still piecing all moving parts together in my head.</p>
  <p>On my server side I'm using <a href="https://typegraphql.com/" rel="noreferrer">TypeGraphQL</a> which uses <code>class-validator</code> to perform validation of the queries coming in. On the client side I'm using Relay. When the validations fail, my <code>commitMutation</code> call in Relay calls <code>onError</code> and passes a string representation of the error, but the actual response from the server looks like this:</p>
  <pre><code>{
    &quot;errors&quot;: [
      {
        &quot;message&quot;: &quot;Argument Validation Error&quot;,
        &quot;locations&quot;: [
          {
            &quot;line&quot;: 2,
            &quot;column&quot;: 3
          }
        ],
        &quot;path&quot;: [
          &quot;updateCurrentUser&quot;
        ],
        &quot;extensions&quot;: {
          &quot;code&quot;: &quot;INTERNAL_SERVER_ERROR&quot;,
          &quot;exception&quot;: {
            &quot;validationErrors&quot;: [
              {
                &quot;target&quot;: {
                  &quot;name&quot;: &quot;ueoa&quot;,
                  &quot;nickname&quot;: &quot;ueoa&quot;,
                  &quot;email&quot;: &quot;&quot;
                },
                &quot;value&quot;: &quot;&quot;,
                &quot;property&quot;: &quot;email&quot;,
                &quot;children&quot;: [],
                &quot;constraints&quot;: {
                  &quot;isEmail&quot;: &quot;email must be an email&quot;
                }
              }
            ],
            &quot;stacktrace&quot;: [
              &quot;Error: Argument Validation Error&quot;,
              &quot;    at Object.validateArg (C:\\Users\\pupeno\\Documents\\Flexpoint Tech\\imok\\node_modules\\type-graphql\\dist\\resolvers\\validate-arg.js:24:15)&quot;,
              &quot;    at runMicrotasks (&lt;anonymous&gt;)&quot;,
              &quot;    at processTicksAndRejections (internal/process/task_queues.js:97:5)&quot;,
              &quot;    at async Promise.all (index 0)&quot;
            ]
          }
        }
      }
    ],
    &quot;data&quot;: null
  }
  </code></pre>
  <p>In this case, I left the email blank and thus on <code>errors[0].extensions.exception.validationErrors[0].constraints.isEmail</code> I have the error: &quot;email must be an email&quot;.</p>
  <p>Is there a way for Relay to let me access this structure to turn this errors into UI errors for the user? Or are these errors the equivalent of a 500 and I should implement my own separate error handling (equivalent of a 401)?</p>
  <p>I do most of my validation on the client, but uniqueness can only be on done on the server and I'm trying to figure out the protocol between the two.</p>