'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
-
Let's say I have hundreds of entries in an
articles
channel. Consider this endpoint:My
'limit' => 3
gets ignored becausepaginate
is set totrue
by 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
paginate
istrue
, then I think it would be better to paginate only if the elements returned exceed whateverelementsPerPage
is set to.So for example, if this is what's happening:
And you're querying with a
limit
of12
, you would have two pages. If you're querying with alimit
of9
, 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' => false
anytime you want tolimit
your query.Beta Was this translation helpful? Give feedback.
All reactions