mirror of
https://github.com/strapi/strapi.git
synced 2025-11-01 10:23:34 +00:00
feat(graphql): add option to enable playground anywhere
This commit is contained in:
parent
8c7e31f1c3
commit
295aef53b0
@ -1,5 +1,6 @@
|
||||
{
|
||||
"endpoint": "/graphql",
|
||||
"shadowCRUD": true,
|
||||
"playgroundAlways": false,
|
||||
"depthLimit": 7
|
||||
}
|
||||
|
||||
@ -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}));
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user