kubb-labs / kubb

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

[KUB-24] Duplicated InfiniteData for react-query v4 in infiniteQueries #1307

Closed stijnvanhulle closed 7 hours ago

stijnvanhulle commented 7 hours 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<A>;

type C = B['data'];

InfiniteData duplicates:

image

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:

type A = typeof useFindPetsByStatusHookInfinite<FindPetsByStatus['response']>;

type B = ReturnType<A>;

type C = B['data'];

Working fine!

image

KUB-24

linear[bot] commented 7 hours ago

KUB-23 Duplicated InfiniteData for react-query v4 in infiniteQueries