'Validation error of type UnknownType: Unknown type - AWS amplify with React Native

I'm trying to create data on Appsync with react native by using

await API.graphql(graphqlOperation(createBotdata, {input: dataEntry}))

But I get this error: error creating dataEntry: {"data": null, "errors": [{"locations": [Array], "message": "Validation error of type UnknownType: Unknown type CreateBotdataInput", "path": null}, {"locations": [Array], "message": "Validation error of type UnknownType: Unknown type ModelBotdataConditionInput", "path": null}, {"locations": [Array], "message": "Validation error of type FieldUndefined: Field 'createBotdata' in type 'Mutation' is undefined @ 'createBotdata'", "path": null}]}

I can confirm that I have it all, CreateBotdataInput, ModelBotdataConditionInput and createBotdata at mutation.js mutation.js-screenshot

I also can confirm that variable type are alinged as well. schema.graphql-screenshot

dataENtry:  {"client_id": "yo7634", "id": "yo7634", "lock_status": 3, "timestamp": ""}

Finally, I do import mutations.js on the file as well.

import { createBotdata } from '../src/graphql/mutations'

This bug is dirving me crazy so I'll be greatful if I can get a pointer to fix it 🙏



Sources

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

Source: Stack Overflow

Solution Source