It might be a stupid question but I couldn't find the information in the Payload documentation. I'm trying to fetch my data without any pagination. Is there a cleaner way to do it without doing :
axios.get("/my-query?limit=10000")?
AFAIK it's not documented, but you can set limit to 0:
https://github.com/payloadcms/payload/blob/324b51e778306a52376350235a691a7913063a58/src/collections/operations/find.ts#L129Good catch, the documenation could probably put in a note about not paginating, though, it's likely less common behavior.
I was using limit=0 for some REST request but after updating to payload 2.0 it stopped working, but I can't find that documented anywhere. Is this a bug or did something change?
Apparently they changed some stuff and I’m also facing the same issue now
I'm now using limit=1000 which is not ideal, but I can't find a workaround. In the documentation limit=0 is not documented but it says pagination can be disabled only for the Local API. I guess that's changed without documenting it.
There's an open issue on the matter :
https://github.com/payloadcms/payload/issues/4143I had an issue with only adding
?limit=0
. The query failed because the defaul locale was appended to the query. Therefore I had to set it to
usePayloadAPI(
'http://localhost:4000/api/surveyQuestions?limit=0&locale=no',
)
Star
Discord
online
Get dedicated engineering support directly from the Payload team..