Skip to content

Conversation

brolnickij
Copy link
Contributor

@brolnickij brolnickij commented Sep 9, 2025

  • implement a defineQueryOptions factory for every xxxQuery
  • normalized all parts of each query key using _JSONValue (so keys are consistent and type-safe)
  • updated the docs for xxxQuery - kept only the "canonical usage" examples
  • updated examples in openapi-ts-pinia-colada
  • enhance generated query keys by serializing parameters into JSON-safe values via serializeQueryKeyValue instead of embedding raw body / query

Close #2597

Copy link

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

Copy link

changeset-bot bot commented Sep 9, 2025

🦋 Changeset detected

Latest commit: a3b29a9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@hey-api/openapi-ts Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Sep 9, 2025

@brolnickij is attempting to deploy a commit to the Hey API Team on Vercel.

A member of the Team first needs to authorize it.

@brolnickij brolnickij changed the title WIP refactor(pinia-colada): migrate queries to defineQueryOptions refactor(pinia-colada): migrate queries to defineQueryOptions Sep 9, 2025
@mrlubos
Copy link
Member

mrlubos commented Sep 9, 2025

@brolnickij hold your horses on this one a bit, #2582 is almost ready and it contains some new concepts

@brolnickij
Copy link
Contributor Author

@mrlubos

i didnt see your note and already implemented the core logic

totally fine if #2582 breaks this - i update my work and help with the migration once it lands!

Copy link

codecov bot commented Sep 9, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 26.41%. Comparing base (6da3159) to head (a3b29a9).
⚠️ Report is 65 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2610      +/-   ##
==========================================
+ Coverage   26.25%   26.41%   +0.15%     
==========================================
  Files         386      387       +1     
  Lines       37363    37484     +121     
  Branches     1864     1907      +43     
==========================================
+ Hits         9811     9901      +90     
- Misses      27539    27570      +31     
  Partials       13       13              
Flag Coverage Δ
unittests 26.41% <ø> (+0.15%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link

pkg-pr-new bot commented Sep 9, 2025

Open in StackBlitz

npm i https://pkg.pr.new/hey-api/openapi-ts/@hey-api/codegen-core@2610
npm i https://pkg.pr.new/hey-api/openapi-ts/@hey-api/nuxt@2610
npm i https://pkg.pr.new/hey-api/openapi-ts/@hey-api/openapi-ts@2610
npm i https://pkg.pr.new/hey-api/openapi-ts/@hey-api/vite-plugin@2610

commit: a3b29a9

@mrlubos
Copy link
Member

mrlubos commented Sep 9, 2025

@brolnickij merged my big thing, seems there are no conflicts and you just need to re-run the snapshots

@brolnickij brolnickij requested a review from mrlubos September 25, 2025 07:46
@brolnickij
Copy link
Contributor Author

@mrlubos whenever you got a moment, could you take a look at my fix?

P.S. CI is still red even though everything passes locally (looks like the new snapshot didnt stick on the runner)

@mrlubos
Copy link
Member

mrlubos commented Sep 25, 2025

@brolnickij can you try git add the snapshots folder? Sometimes you need to do it instead of git add . because of the ignore rules in openapi-ts, I never get around to fixing it. That would explain why it's passing locally

@brolnickij
Copy link
Contributor Author

@mrlubos hmm, i checked, and all the changes were already pushed there are no unstaged or unpushed snapshots left in the local repository

@mrlubos
Copy link
Member

mrlubos commented Sep 25, 2025

I can have a look later!

@brolnickij
Copy link
Contributor Author

can you try git add the snapshots folder? Sometimes you need to do it instead of git add . because of the ignore rules in openapi-ts, I never get around to fixing it. That would explain why it's passing locally

u were right

Copy link
Member

@mrlubos mrlubos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks pretty good, only a few minor asks!

@@ -22,6 +22,7 @@ export const createQueryKeyFunction = ({
}: {
plugin: PiniaColadaPlugin['Instance'];
}) => {
const coreModule = '../core/queryKeySerializer.gen';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@brolnickij This is the only thing I don't feel good about. Can you re-export serializeQueryKeyValue from the client and import it from the client the same way we import elsewhere?

Copy link
Contributor Author

@brolnickij brolnickij Oct 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@brolnickij brolnickij requested a review from mrlubos October 2, 2025 15:05
Copy link

vercel bot commented Oct 2, 2025

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

Project Deployment Preview Comments Updated (UTC)
hey-api-docs Ready Ready Preview Comment Oct 2, 2025 7:00pm

@mrlubos mrlubos merged commit 557dce2 into hey-api:main Oct 2, 2025
24 of 26 checks passed
@hey-api hey-api bot mentioned this pull request Oct 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
javascript Pull requests that update Javascript code size:XXL This PR changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

@pinia/colada: use defineQueryOptions() for reactive options
3 participants