How to increase the default number of results (30) in graphql?
How can I increase the default number of results in graphql query results? I am receiving 30 results and I want to fetch 100. How to do this?
7 Replies
Hi @arnavsaxena, can you provide the query you are using? I guess you can add the param
limit
to the queryEven after adding :
{
"limit": 1000,
},
I am receiving only 30 results.
can you provide the query
query: "query FindManyPeople($filter: PersonFilterInput, $orderBy: [PersonOrderByInput], $lastCursor: String, $limit: Int) {
people(filter: $filter, orderBy: $orderBy, first: $limit, after: $lastCursor) {
edges {
node{
id
}
cursor
}
}
}"
operationName: "FindManyPeople"
variables: " {
"limit": 1000,
"lastCursor":"WyIwNWI2Mzk4NC05YWFhLTRkMDItOTc5Ny0zNzFlN2U3MWVjMDIiXQ=="
}"
Looks like the max limit is 60
Since you are using JS you could do something like:
And while hasNextPage is true, you set lastCursor param to your previous endCursor
So this has to go in a while loop?
yes! the current maximum page size is 60, it's a bit too heavy for the backend otherwise and could impact other users