title: How to upload file to AWS S3 using AWS AppSync
body: <p>Following <a href="https://docs.aws.amazon.com/appsync/latest/devguide/building-a-client-app-react.html#complex-objects" rel="noreferrer">this docs/tutorial</a> in AWS AppSync Docs.</p>
  
  <p>It states:</p>
  
  <blockquote>
    <p>With AWS AppSync you can model these as GraphQL types. If any of your mutations have a variable with bucket, key, region, mimeType and localUri fields, the SDK will upload the file to Amazon S3 for you.</p>
  </blockquote>
  
  <p>However, I cannot make my file to upload to my s3 bucket. I understand that tutorial missing a lot of details. More specifically, the tutorial does not say that the <code>NewPostMutation.js</code> needs to be changed.</p>
  
  <p>I changed it the following way:</p>
  
  <pre><code>import gql from 'graphql-tag';
  
  export default gql`
  mutation AddPostMutation($author: String!, $title: String!, $url: String!, $content: String!, $file: S3ObjectInput ) {
      addPost(
          author: $author
          title: $title
          url: $url
          content: $content
          file: $file
      ){
          __typename
          id
          author
          title
          url
          content
          version
      }
  }
  `
  </code></pre>
  
  <p>Yet, even after I have implemented these changes, the file did not get uploaded...</p>