Sarah Diba
Sarah Diba

Reputation: 97

How to disable strapi graphql playground on production mode

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?

Upvotes: 1

Views: 702

Answers (1)

Leandro Raveli
Leandro Raveli

Reputation: 11

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.

Upvotes: 0

Related Questions