Skip to content

Conversation

@matsu3m
Copy link
Contributor

@matsu3m matsu3m commented Jun 7, 2025

Status

READY

Description

Fixes #2145
Fix #2153

Starting from TanStack Query v5.80.0, PR #9224 removed the unnecessary TQueryData generic from InfiniteQueryObserverOptions, reducing the number of type parameters from 6 to 5. This change causes type errors in Orval-generated code.

スクリーンショット 2025-06-08 1 49 37

This fix adds version detection to conditionally generate the correct number of type arguments:

  • For v5.80.0 and later: generates 5 arguments (excluding the redundant funcReturnType)
  • For earlier versions: retains 6 arguments for backward compatibility

Steps to Test or Reproduce

  1. Set the @tanstack/react-query (or vue-query, svelte-query) package version to below 5.80.0 (e.g., 5.79.0)
  2. Run Orval – generated code should use 6 type arguments in UseInfiniteQueryOptions
  3. Set the version to 5.80.0 or above (e.g., 5.80.0 or latest)
  4. Run Orval again – generated code should use 5 type arguments (excluding the redundant funcReturnType)

@melloware melloware merged commit 725e6a6 into orval-labs:master Jun 8, 2025
2 checks passed
@ph8nt0m
Copy link

ph8nt0m commented Jun 10, 2025

@melloware What version should be used to solve this problem?

@melloware melloware added this to the 7.10.0 milestone Jun 10, 2025
@melloware
Copy link
Collaborator

@ph8nt0m has not been released yet this was just fixed will be in next release 7.10.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working tanstack-query TanStack Query related issue

Projects

None yet

5 participants