Skip to content

@tanstack/react-query 5.80.x breaks useInfiniteQuery inference #2355

@daviduzumeri

Description

@daviduzumeri

openapi-react-query version

0.5.0

Description

Pretty much what it says in the header. When you use useInfiniteQuery with a @tanstack/react-query version greater than 5.80.0, it breaks the inference on getNextPageParam (basically the entire InfiniteQueryOptions type becomes any).

Reproduction

Repro here: https://github.com/daviduzumeri/openapi-fetch-infinitequery-repo

If you mouse over lastPage and allPages in the getNextPageParam implementation they'll be any instead of the correct generated type. If you backpedal to 0.79.2, it works fine.

Expected result

It should infer correctly.

Extra

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingopenapi-react-queryRelevant to openapi-react-query

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions