'strapi graphql limit only return 100 items even if I set limit to -1

currently I have some problem with strapi graphql query. I can only query about 100 items max.

here is my query: query StudioList { studios(limit: -1) { id slug name } }

with or without limit always return 100 items. how do i query for more than 100? thanks..



Solution 1:[1]

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,
    },
  },
};

change the amountlimit to whatever you want.. then restart the server, now it should shows more than 100 items.

Solution 2:[2]

I try with version of strap 3.6.8 but that's doesn't work. I rebuild strapi "npm build" & "yarn develop"

module.exports = {
  //
  graphql: {
    endpoint: '/graphql',
    shadowCRUD: true,
    playgroundAlways: false,
    depthLimit: 7,
    amountLimit: 2500,
    apolloServer: {
      tracing: false,
    },
  },
};

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Hadezuka
Solution 2 Kamy