kubb-labs / kubb

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

[KUB-38] Duplicated InfiniteData for react-query v4 in infiniteQueries #1321

Closed stijnvanhulle closed 1 month ago

stijnvanhulle 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<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-38

linear[bot] commented 1 month ago

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