UnknownType 类型的验证错误:未知类型 - AWS 使用 React Native 进行放大
我正在尝试使用 React Native 在 Appsync 上创建数据,
await API.graphql(graphqlOperation(createBotdata, {input: dataEntry}))
但我收到此错误: 创建 dataEntry 时出错:{“data”:null,“errors”:[{“locations”:[Array],“message”:“类型 UnknownType 的验证错误:未知类型 CreateBotdataInput”,“path”:null} , {"locations": [Array], "message": "类型 UnknownType 的验证错误:未知类型 ModelBotdataConditionInput", "path": null}, {"locations": [Array], "message": "Validation error of type FieldUndefined: Field 'createBotdata' in type 'Mutation' is undefined @ 'createBotdata'", "path": null}]}
我可以确认我已经这一切,位于mutation.js的CreateBotdataInput
、ModelBotdataConditionInput
和createBotdata
mutation.js-screenshot
我还可以确认变量类型也已更改。 schema.graphql-screenshot
dataENtry: {"client_id": "yo7634", "id": "yo7634", "lock_status": 3, "timestamp": ""}
最后,我还在文件中导入mutations.js。
import { createBotdata } from '../src/graphql/mutations'
这个错误让我发疯,所以如果我能得到一个修复它的指针,我将不胜感激
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
????
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论