Add GraphQL limit settings

This commit is contained in:
DMehaffy 2018-11-29 03:46:30 -07:00
parent 511d913abf
commit 2b38a92277
2 changed files with 4 additions and 3 deletions

View File

@ -2,5 +2,6 @@
"endpoint": "/graphql",
"shadowCRUD": true,
"playgroundAlways": false,
"depthLimit": 7
"depthLimit": 7,
"amountLimit": 100
}

View File

@ -51,8 +51,8 @@ module.exports = {
amountLimiting: params => {
if (params.limit && params.limit < 0) {
params.limit = 0;
} else if (params.limit && params.limit > 100) {
params.limit = 100;
} else if (params.limit && params.limit > strapi.plugins.graphql.config.amountLimit) {
params.limit = strapi.plugins.graphql.config.amountLimit;
}
return params;