GraphQL Playground: I can't access Schema and Docs in Production

System Information
  • Strapi Version: 4.1.7
  • Operating System: macOS / Linux
  • Database: Postgres
  • Node Version: 16.14.2
  • NPM Version: 8.5.0
  • Yarn Version: 1.22.18

Hello everyone,
I can’t access Schema and Docs for graphql playground in production

config > env > production > plugins.js:

module.exports = ({ env }) => ({
  graphql: {
    config: {
      endpoint: "/graphql",
      shadowCRUD: true,
      playgroundAlways: true,
      introspection: true,
      depthLimit: 7,
      amountLimit: 100,
      apolloServer: {
        tracing: false,
      },
    },
  },
});

I tried to deploy production in local and heroku. Both did not work.

After some debugging in chrome debugging tools. I found out that introspection config need to be put in apolloServer.

Something like this:

module.exports = ({ env }) => ({
  graphql: {
    config: {
      playgroundAlways: env.bool("ENABLE_GRAPHQL_PLAYGROUND", false),
      apolloServer: {
        tracing: false,
        introspection: env.bool("ENABLE_GRAPHQL_PLAYGROUND", false),
      },
    },
  },
});