feat(graphql): add option to enable playground anywhere

This commit is contained in:
Johann Pinson 2018-06-18 11:22:52 +02:00
parent 8c7e31f1c3
commit 295aef53b0
2 changed files with 2 additions and 1 deletions

View File

@ -1,5 +1,6 @@
{
"endpoint": "/graphql",
"shadowCRUD": true,
"playgroundAlways": false,
"depthLimit": 7
}

View File

@ -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}));
}