diff --git a/packages/strapi-plugin-graphql/config/settings.json b/packages/strapi-plugin-graphql/config/settings.json index 1501513aee..deda1e7b90 100644 --- a/packages/strapi-plugin-graphql/config/settings.json +++ b/packages/strapi-plugin-graphql/config/settings.json @@ -1,5 +1,6 @@ { "endpoint": "/graphql", "shadowCRUD": true, + "playgroundAlways": false, "depthLimit": 7 } diff --git a/packages/strapi-plugin-graphql/hooks/graphql/index.js b/packages/strapi-plugin-graphql/hooks/graphql/index.js index a8e0586432..dc0dd42b4f 100644 --- a/packages/strapi-plugin-graphql/hooks/graphql/index.js +++ b/packages/strapi-plugin-graphql/hooks/graphql/index.js @@ -123,7 +123,7 @@ module.exports = strapi => { })(ctx, next)); // Disable GraphQL Playground in production environment. - if (strapi.config.environment !== 'production') { + if (strapi.config.environment !== 'production' || strapi.plugins.graphql.config.playgroundAlways) { router.get('/playground', koaPlayground({ endpoint: strapi.plugins.graphql.config.endpoint})); }