即使我将限制设置为 -1,trapi graphql 限制也只返回 100 个项目 [英] strapi graphql limit only return 100 items even if I set limit to -1
本文介绍了即使我将限制设置为 -1,trapi graphql 限制也只返回 100 个项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
目前我对 Strapi graphql 查询有一些问题.我最多只能查询大约 100 个项目.
currently I have some problem with strapi graphql query. I can only query about 100 items max.
这是我的查询:query StudioList { studios(limit: -1) { id slug name } }
有或没有限制总是返回 100 个项目.我如何查询超过 100 个?谢谢..
with or without limit always return 100 items. how do i query for more than 100? thanks..
推荐答案
我找到了解决方案:如果您的 Strapi ./config 文件夹中有 plugins.js 文件,请添加以下代码:
I found the solution: if you have plugins.js file in your strapi ./config folder, then add the following code:
module.exports = {
//
graphql: {
endpoint: '/graphql',
shadowCRUD: true,
playgroundAlways: false,
depthLimit: 7,
amountLimit: 2500,
apolloServer: {
tracing: false,
},
},
};
将金额限制更改为您想要的任何内容..然后重新启动服务器,现在它应该显示超过 100 个项目.
change the amountlimit to whatever you want.. then restart the server, now it should shows more than 100 items.
这篇关于即使我将限制设置为 -1,trapi graphql 限制也只返回 100 个项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文