graphQl throws的buildschema typeError:nodes.flatmap不是函数'

发布于 2025-02-09 00:46:10 字数 526 浏览 1 评论 0原文

我正在使用节点版本10.24.0。

但是,当我尝试官方网站的示例时。

const graphql = require('graphql');

const schema = graphql.buildSchema(`
    type Query {
    hello: String
}`);

我会收到以下错误。

TypeError: nodes.flatMap is not a function

我正在使用 [email 

procected

] >在开始之前,您应该安装节点V6,尽管这些示例主要应该在先前版本的节点中使用。

,我该怎么做才能让GraphQl在这里工作?

Am using node version 10.24.0.

But when I try the example from the official site.

const graphql = require('graphql');

const schema = graphql.buildSchema(`
    type Query {
    hello: String
}`);

I get the following error.

TypeError: nodes.flatMap is not a function

Am using [email protected]

On the graphql official page, it says

Before getting started, you should have Node v6 installed, although the examples should mostly work in previous versions of Node as well.

So What can I do to get graphql to work here?

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

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

发布评论

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