title: AWS AppSync GraphQL - using union as mutation return causes error
body: <p>I'm creating a GraphQL schema using AWS AppSync and I want to use <code>Union</code> as mutation return. I'd like to write mutation this way:</p>
  
  <pre><code>mutation addUpdateTariff($tariff: TariffInput!, $seasonalTimeTariff: [SeasonalTimeTariffInput!]) {
    addUpdateTariff(tariff: $tariff, seasonalTimeTariff: $seasonalTimeTariff) {
      id
      type
      values {
        ... on SteppedTariff {
          endDate
        }
        ... on SeasonalTimeTariff {
          endDate
          peakConsumption
        }
      }
    }
  }
  </code></pre>
  
  <p>But I'm getting this error:</p>
  
  <pre><code>Request failed with status code 400
  </code></pre>
  
  <p>The field <code>values</code> can be of the type <code>SteppedTariff</code> or <code>SeasonalTimeTariff</code>, depends the inputs of <code>addUpdateTariff</code> mutation. As far as I've searched, <code>Union</code> is only used in queries and I didn't find some documentation telling it cannot be used in a different way.</p>
  
  <p>Am I missing something or I really cannot use <code>Union</code> this way?</p>
  
  <p><strong>Schema:</strong></p>
  
  <pre><code>type Tariff {
    id: ID!
    type: TariffType!
    values: [TariffValue!]
  }
  
  type SteppedTariff {
    endDate: AWSDate
  }
  
  type SeasonalTimeTariff {
    endDate: AWSDate
    peakConsumption: Float
  }
  
  union TariffValue = SeasonalTimeTariff | SteppedTariff
  </code></pre>
  
  <p><strong>Testing different schemas for Tariff values:</strong></p>
  
  <ol>
  <li><code>values: [String]</code></li>
  </ol>
  
  <p><strong>Query:</strong></p>
  
  <pre><code>mutation addUpdateTariff($tariff: TariffInput!, $seasonalTimeTariff: [SeasonalTimeTariffInput!]) {
    addUpdateTariff(tariff: $tariff, seasonalTimeTariff: $seasonalTimeTariff) {
      id
      type
      values
    }
  }
  </code></pre>
  
  <p><strong>Response:</strong></p>
  
  <pre><code>{
    "data": {
      "addUpdateTariff": {
        "id": "843eadcf-48bd-4d58-93ec-8bbe96db3635",
        "type": "SeasonalTime",
        "values": [
          "{endDate=2019-02-02}"
        ]
      }
    }
  }
  </code></pre>
  
  <ol start="2">
  <li><code>values: [SeasonalTimeTariff]</code></li>
  </ol>
  
  <p><strong>Query:</strong></p>
  
  <pre><code>mutation addUpdateTariff($tariff: TariffInput!, $seasonalTimeTariff: [SeasonalTimeTariffInput!]) {
    addUpdateTariff(tariff: $tariff, seasonalTimeTariff: $seasonalTimeTariff) {
      id
      type
      values {
        endDate
      }
    }
  }
  </code></pre>
  
  <p><strong>Response:</strong></p>
  
  <pre><code>{
    "data": {
      "addUpdateTariff": {
        "id": "7f77c5d9-2b06-4bb8-a678-10996addc4e1",
        "type": "SeasonalTime",
        "values": [
          {
            "endDate": "2019-02-02"
          }
        ]
      }
    }
  }
  </code></pre>