You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, this is not ideal as it bypasses TypeScript's type checking and could lead to runtime errors.
Expected Behavior
Parameters should be optional since undefined is handled:
exportconstgetListPetsQueryKey=(params?: ListPetsParams)=>{return[`http://localhost:8000/pets`, ...(params ? [params] : [])]asconst;};// Should be able to invalidate cachequeryClient.invalidateQueries(getListPetsQueryKey());
Problem
The generated queryKey function requires parameters to be mandatory when the type has required fields, even though:
...(params ? [params] : [])
Current Behavior
Current Workaround
We are currently using type assertion as a workaround:
However, this is not ideal as it bypasses TypeScript's type checking and could lead to runtime errors.
Expected Behavior
Parameters should be optional since undefined is handled:
orval version: "7.4.1"
Node.js version: "v22.13.0"
pnpm version: "9.12.2"
The text was updated successfully, but these errors were encountered: