mirror of
https://github.com/strapi/strapi.git
synced 2025-11-24 22:21:38 +00:00
Add GraphQL limit settings
This commit is contained in:
parent
511d913abf
commit
2b38a92277
@ -2,5 +2,6 @@
|
|||||||
"endpoint": "/graphql",
|
"endpoint": "/graphql",
|
||||||
"shadowCRUD": true,
|
"shadowCRUD": true,
|
||||||
"playgroundAlways": false,
|
"playgroundAlways": false,
|
||||||
"depthLimit": 7
|
"depthLimit": 7,
|
||||||
|
"amountLimit": 100
|
||||||
}
|
}
|
||||||
|
|||||||
@ -51,8 +51,8 @@ module.exports = {
|
|||||||
amountLimiting: params => {
|
amountLimiting: params => {
|
||||||
if (params.limit && params.limit < 0) {
|
if (params.limit && params.limit < 0) {
|
||||||
params.limit = 0;
|
params.limit = 0;
|
||||||
} else if (params.limit && params.limit > 100) {
|
} else if (params.limit && params.limit > strapi.plugins.graphql.config.amountLimit) {
|
||||||
params.limit = 100;
|
params.limit = strapi.plugins.graphql.config.amountLimit;
|
||||||
}
|
}
|
||||||
|
|
||||||
return params;
|
return params;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user