mirror of
https://github.com/strapi/strapi.git
synced 2025-11-01 18:33:55 +00:00
Add GraphQL limit settings
This commit is contained in:
parent
511d913abf
commit
2b38a92277
@ -2,5 +2,6 @@
|
||||
"endpoint": "/graphql",
|
||||
"shadowCRUD": true,
|
||||
"playgroundAlways": false,
|
||||
"depthLimit": 7
|
||||
"depthLimit": 7,
|
||||
"amountLimit": 100
|
||||
}
|
||||
|
||||
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user