'paginate' setting overrides 'limit' query param #150
Unanswered
modelesque
asked this question in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Let's say I have hundreds of entries in an
articleschannel. Consider this endpoint:My
'limit' => 3gets ignored becausepaginateis set totrueby default, and therefore the query will ignore this and get all entries.Currently I'm working on a huge export of entries to import via Feed Me somewhere else, and I want to run some tests but not with all 900+ entries I have in that channel. I just want to test with 3. I finally figured out that my endpoint was still querying for every entry because it was set to paginate the entries, and I guess the logic assumes you wouldn't want to paginate and limit at the same time. If
paginateistrue, then I think it would be better to paginate only if the elements returned exceed whateverelementsPerPageis set to.So for example, if this is what's happening:
And you're querying with a
limitof12, you would have two pages. If you're querying with alimitof9, then you would just have one page.There's no mention of this in the docs, so it feels like an unfortunate gotcha that requires you to remember to set
'paginate' => falseanytime you want tolimityour query.Beta Was this translation helpful? Give feedback.
All reactions