'"amplify push" creates new varaibles in type at AWS Appsync - React Native

When I do amplify push , I get a few variables in the Appsync Schema.

This is from schema.graphql in react native amplify/backend folder.

type Botdata @model (subscriptions: null){
  client_id: String!
  id: String!
  lock_status: Float
}

And this is what I get on the Appsync Schema after amplify push

type Botdata {
   client_id: String!
   id: String!
   lock_status: Float
   createdAt: AWSDateTime!
   updatedAt: AWSDateTime!
   _version: Int!
   _deleted: Boolean
   _lastChangedAt: AWSTimestamp!
}

This causes my undefined type error for the entire operation. Please help me. Thanks!



Solution 1:[1]

Maybe you was turn on Optimistic Concurrency. This helpful when you have conflict data version between app and database but you need:

  • Check _version when you use mutation if _version on app different _version field of row data on Database then operation mutation you return error.

If you don't need Optimistic Concurrency you can turn of that:

  • go to folder project open command line with administrator.
  • run: amplify update api
  • choose: graphql
  • choose: Disable conflict detection
  • update api to cloud: amplify push Hope my answer helpful for you.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Nguy?n V?n Phóng