Schema is :
type UserInfo @model{
id: ID!
title: String!
status: PostStatus!
rating: Int
content: String
}
I hit the command
amplify codegen models
here is the code
try {
console.log("first")
const post = await DataStore.save(
new UserInfo({
title: 'My First Post',
rating: 10,
status: "ACTIVE"
})
);
console.log('Post saved successfully!', post);
} catch (error) {
console.log('Error saving post', error);
}