title: Updating data stored in DynamoDB using AWS Amplify graphqlOperation
body: <p>I am trying to update the user data using the API from AWS Amplify. I can add new record to the connected table with the createUser function imported from graphql mutation but the updateUser doesn't work and returning error. The function I used is defined as below:</p>
  <pre><code>async function UpdateUsers() {
      try {
        const user = {
          role: 'student',
          fname: formState.fname,
          lname: formState.lname,
          age: formState.age,
          school: formState.school,
          class_name: formState.class_name,
          sid: formState.sid,
          test1: formState.test1,
          test2: formState.test2,
          test3: formState.test3
        }
        const newData = await API.graphql(graphqlOperation(updateUser, {input: user}))
      } catch (err) {
        alert('Error when updating user', err)
      }
    }
  }
  </code></pre>
  <p>I also tried to do it another way by deleting the old record and create a new one. But the deleteUser function generated automatically from graphql mutation did not work either.</p>