openapi-typescript icon indicating copy to clipboard operation
openapi-typescript copied to clipboard

Better typesafety for `useInfiniteQuery`

Open patrickariel opened this issue 10 months ago • 4 comments

Changes

Makes pageParamName typesafe and required. This PR also removes the fallbacks for pageParamName and pageParam, because they shouldn't have default values in the first place (and they're also no longer needed).

The should use custom cursor params test is also removed, because I believe that it shouldn't be allowed now that the param is typesafe. Users can always cast the type if they think the schema isn't right.

How to Review

Most of the changes here are type-level. I'm still not very familiar with the type utilities, so if there are any mistakes let me know.

Checklist

  • [x] Unit tests updated
  • [x] docs/ updated (if necessary)
  • [ ] pnpm run update:examples run (only applicable for openapi-typescript)

patrickariel avatar Jan 28 '25 10:01 patrickariel