如何在生产模式下禁用strapi graphql操场

发布于 2025-02-07 21:30:31 字数 628 浏览 1 评论 0原文

我已经将此摘要添加到./ config/plugins.js
中,

module.exports = {
  graphql: {
    enabled: true,
    config: {
      endpoint: "/graphql",
      shadowCRUD: true,
      playgroundAlways: process.env.NODE_ENV === "development",
      depthLimit: 50,
      amountLimit: 100,
      defaultLimit: 100,
      maxLimit: 100,
      apolloServer: {
        tracing: true,
      },
    },
  },
  ckeditor: true,
};


I also have changed `playgroundAlways` value like this:
    playgroundAlways:false

但是我可以在开发和生产模式下看到GraphQl Playground。
如何隐藏或禁用GraphQl操场?

I've added this snippet into ./config/plugins.js

module.exports = {
  graphql: {
    enabled: true,
    config: {
      endpoint: "/graphql",
      shadowCRUD: true,
      playgroundAlways: process.env.NODE_ENV === "development",
      depthLimit: 50,
      amountLimit: 100,
      defaultLimit: 100,
      maxLimit: 100,
      apolloServer: {
        tracing: true,
      },
    },
  },
  ckeditor: true,
};

I also have changed `playgroundAlways` value like this:

    playgroundAlways:false

But I can see graphql playground in development and production mode.

How can I hide or disable graphql playground?

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

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

发布评论

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

评论(1

骄傲 2025-02-14 21:30:31

如何定义开始应用程序脚本?
您是否设置node_env =生产?

要仔细检查设置断点或控制台。

How are the start app script defined?
Are you setting the NODE_ENV=production?

To double check set a breakpoint or console.log process.env variable to see what you are getting at the runtime.

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