Shaddix / react-query-swagger

Generates react-query hooks based on Swagger API definitions
MIT License
122 stars 4 forks source link

Persistor doesn't work with useInfiniteQuery #11

Closed Shaddix closed 1 year ago

Shaddix commented 1 year ago

data.pages and data.pageParams are missing

Shaddix commented 1 year ago

For hydration to work with useInfiniteQuery the queryKey parameter should start with 2 same items as the underlying 'normal' query. E.g. the Query key for 'findPet' query is ['Client', 'findPetsByStatus', status as any ]. The queryKey for your infinite query that uses the same results, should start with ['Client', 'findPetsByStatus']