kubb-labs / kubb

The ultimate toolkit for working with APIs.
https://kubb.dev
MIT License
729 stars 67 forks source link

Duplicated InfiniteData for react-query v4 in infiniteQueries #1293

Closed RabbitShare closed 1 month ago

RabbitShare commented 1 month ago

What version of kubb is running?

No response

What platform is your computer?

No response

What version of external packages are you using(@tanstack-query, MSW, React, Vue, ...)

No response

What steps can reproduce the bug?

  1. Open kubb example from site https://codesandbox.io/p/devbox/wispy-rgb-sgm8cw?embed=1
  2. Find file useFindPetsByStatusHook.ts
  3. Write on both of the file
    
    type A = typeof useFindPetsByStatusHookInfinite<
    InfiniteData<FindPetsByStatus['response']>
    >;

type B = ReturnType;

type C = B['data'];

InfiniteData duplicates:
<img width="575" alt="Снимок экрана 2024-10-05 в 02 19 43" src="https://github.com/user-attachments/assets/f4b9d3d0-f099-436b-b58c-941cf2600c53">

### How often does this bug happen?

Every time

### What is the expected behavior?

InfiniteData not duplicates

### Swagger/OpenAPI file?

In sandbox

### Additional information

I think problem with UseInfiniteQueryResult and TData = InfiniteData<FindPetsByStatus['response']>. Using both duplicates InfiniteData
try without InfiniteData:
```typescript
type A = typeof useFindPetsByStatusHookInfinite<FindPetsByStatus['response']>;

type B = ReturnType<A>;

type C = B['data'];

Working fine!

image

KUB-10

stijnvanhulle commented 1 month ago

@RabbitShare This has been resolved as part of Kubb v2.28.1