为什么这个投掷“不能返回无效的字段查询。

发布于 2025-01-31 20:14:50 字数 335 浏览 2 评论 0原文

几周前,我有一个发誓工作的GraphQl Server,但是现在,它突然抛出了“无法无效的字段”错误。

是的,我已经检查了重复。是的,我已经搜索了它。是的,我已经检查了相关的GitHub问题。

我在此处创建了最小的repro: https:// -drkgtc?file = index.js 。我累了,要么在我错过的地方有一些次要包装版本的破坏。

有人知道这里发生了什么吗?

I had a GraphQL server that I swear worked just a few weeks ago, but now, it's suddenly throwing "cannot null non-nullable field" errors.

Yes, I have checked for duplicates. Yes, I have googled it. Yes, I have checked for related GitHub issues.

I created a minimal repro here: https://stackblitz.com/edit/graphql-drkgtc?file=index.js. Either I'm tired, or there's some breaking change in a minor package version somewhere that I missed.

Does anyone have an idea what is going on here?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

羅雙樹 2025-02-07 20:14:50

尝试此对象的root变量:

var root = {
  Query: {
    hello:() => {return {hello :'hello'}}
  }
};

Try this object for root variable:

var root = {
  Query: {
    hello:() => {return {hello :'hello'}}
  }
};

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文