UnknownType 类型的验证错误:未知类型 - AWS 使用 React Native 进行放大

发布于 2025-01-10 02:02:41 字数 1201 浏览 0 评论 0原文

我正在尝试使用 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的CreateBotdataInputModelBotdataConditionInputcreateBotdata 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文