AWS Amplify DataStore not syncing with DynamoDB

Viewed 28

My DataStore is not syncing with DynamoDB for some reason.

I've ready every issue on stackoverflow to see if I can find a resolution but no dice. There are no errors. Hub is showing the events firing.

Here is an example of the issue:

  try {
    const result = await DataStore.save(
      new Employer({
        name: 'Test Employer',
        rate: 123.45,
      }),
    )

    console.log('Employer saved successfully!')
    console.log(result)

    // const employer = await DataStore.query(Employer)
    // console.log('EMPLOYER = ')
    // console.log(employer)
  } catch (err) {
    console.log('ERROR: An error occurred during getEmployer')
    console.log('Error message was ' + JSON.stringify(err))
  }

DataStore nevers seems to sync with DynamoDB. Other than that everything is fine. No issues. DataStore contains the correct data.

The only difference between my project and the code examples if that I have used Amplify Studio to build the data model and performed Amplify pull to update the project.

When I do an "amplify status" the API looks correct.

The aws-exports.js file seems to be correct. It contains entries for Auth, API, Storage etc. Auth is working correctly.

What am I missing?

0 Answers
Related