You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current SWR integration in Orval doesn't properly support useSWRInfinite pagination. The generated swrKeyLoader function doesn't accept the required pageIndex and previousPageData parameters that SWR Infinite expects, making infinite pagination impossible to implement.
Expected Behavior
The generated swrKeyLoader should:
Accept pageIndex and previousPageData parameters from useSWRInfinite
Pass these parameters to the underlying key loader function
Enable proper infinite pagination functionality
Current Behavior
The generated code creates a swrKeyLoader that doesn't accept any parameters:
melloware
changed the title
useSWRInfinite implementation doesn't support pagination parameters
SWR: useSWRInfinite implementation doesn't support pagination parameters
May 22, 2025
Description
The current SWR integration in Orval doesn't properly support
useSWRInfinite
pagination. The generatedswrKeyLoader
function doesn't accept the requiredpageIndex
andpreviousPageData
parameters that SWR Infinite expects, making infinite pagination impossible to implement.Expected Behavior
The generated
swrKeyLoader
should:pageIndex
andpreviousPageData
parameters from useSWRInfiniteCurrent Behavior
The generated code creates a
swrKeyLoader
that doesn't accept any parameters:This prevents useSWRInfinite from working correctly because it can't pass pagination parameters to determine the next page key.
Steps to Reproduce
useInfinite: true
pageIndex
andpreviousPageData
are not availableProposed Solution
The
swrKeyLoader
should be generated as:Environment
The text was updated successfully, but these errors were encountered: