secure-lavender•1h ago
How can I remap the default Pagination and Sorting query params?
Now, by default they come as
_start
_limit
_sort
_order
but for reasons I need to remap them as refineStart and so on... how can I do that?
2 Replies
Hi @khadhulu. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
Short answer: override your data provider’s getList (and related) methods to emit your desired query param names.
Refine passes unified pagination/sorters to the data provider; mapping to actual query params is entirely up to the provider implementation. The docs’ sample provider shows how _start/_end and _sort/_order are produced via helper functions—replace that logic with your own keys (e.g., refineStart, refineEnd, refineSort, refineOrder) and use your custom provider in <Refine>. [data-provider interface; data-provider-interface (helpers)]
In practice:
- Copy the getList example and change:
- generatePagination -> return { refineStart, refineEnd } (or page/pageSize if you prefer).
- generateSort -> return { refineSort, refineOrder } and join as needed.
- If you use the simple-rest package, you can also spread it and override only getList to keep other methods: dataProvider={{ ...simpleRest, getList: myGetList }}. This is the recommended approach mentioned by the team when different pagination params are required. [Issue 2802]
There’s no built-in switch to rename these keys globally; customization is done at the data provider level. [data-provider interface]
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
<@236239059184386048> Kapa.ai is still learning and improving, please let me know how I did by reacting below.