Record limit of Models is higher by 1 than specified

If I specify for the model to have a limit of 20 records then Skuid will create a SOQL where it says limit to be 21.

Although it seems strange Skuid manages to make it work, as the model only has 20 rows, tables display 20 rows and they show the ‘Load more’ button.

Though, I do not know how I can make it work with REST models. If I specify the limit to be 20, my Apex REST resource will get 21 via the parameter.

If I do paramLimit - 1 Apex will return 20 rows as expected, but Skuid will interpret that I retrieved the max number of rows, since 20 < 21, and it will not allow to ‘load more’.

If I return all 21 rows, and then ‘load more’ will return duplicate rows, since the offset is set to 20 instead of 21. I’m unable to increment offset on the Apex side because I do not know by how much to increment.

  • E.g. I’m pressing load more for 3rd time, Apex will receive a limit of 21 and offset of 60 (since 20*3 = 60), apex does not know it’s the 3rd time and that it should increment by 3.

I assume this is not a bug since Skuid made it work for regular models. How can I make it work for REST models?

Thank you