Skip to content

Improve generated query and response handling#200

Merged
7nohe merged 2 commits into
v3from
codex/address-recommended-issues
Jul 20, 2026
Merged

Improve generated query and response handling#200
7nohe merged 2 commits into
v3from
codex/address-recommended-issues

Conversation

@7nohe

@7nohe 7nohe commented Jul 20, 2026

Copy link
Copy Markdown
Owner

Summary

  • forward TanStack Query cancellation signals to generated query, suspense, prefetch, ensure, and infinite-query SDK calls
  • preserve string cursor types, including schema aliases, and emit correctly typed initial and next-page parameters
  • make useDateType configure runtime response transformers in addition to generated Date model types
  • return complete SDK mutation responses so callers can access response headers
  • update the CLI documentation, usage examples, snapshots, and regression coverage

Why

The generated hooks previously dropped query cancellation signals, assumed numeric pagination even when an OpenAPI cursor was a string alias, exposed Date types without converting response strings at runtime, and narrowed mutation results to response bodies. These behaviors caused cancellation gaps, invalid generated TypeScript, runtime type mismatches, and inaccessible response metadata.

Validation

  • npm run lint
  • npm run build
  • pre-commit suite: 16 test files and 188 tests passed
  • generated React example type-check
  • generated React runtime tests: 6 passed
  • strict TypeScript compilation of generated string-cursor pagination output

Closes #126
Closes #137
Closes #146
Closes #168

@vercel

vercel Bot commented Jul 20, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
openapi-react-query-codegen Ready Ready Preview, Comment Jul 20, 2026 8:19am

@github-actions

github-actions Bot commented Jul 20, 2026

Copy link
Copy Markdown

Coverage Report

Status Category Percentage Covered / Total
🟢 Lines 99.03% (🎯 95%) 514 / 519
🟢 Statements 98.32% (🎯 95%) 527 / 536
🟢 Functions 99.27% (🎯 95%) 137 / 138
🟢 Branches 90.41% (🎯 90%) 217 / 240
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/generate.mts 100% 100% 100% 100%
src/parseOperations.mts 88.73% 76% 94.11% 93.84% 27, 43, 55, 82, 94, 97, 106, 199
src/tsmorph/buildQueryHooks.mts 100% 94.64% 100% 100%
src/tsmorph/buildQueryOptions.mts 100% 100% 100% 100%
Generated in workflow #427 for commit dbab2e5 by the Vitest Coverage Report Action

@7nohe
7nohe marked this pull request as ready for review July 20, 2026 08:03
@7nohe
7nohe merged commit fb268ab into v3 Jul 20, 2026
5 checks passed
@7nohe
7nohe deleted the codex/address-recommended-issues branch July 20, 2026 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant