[draft] expose query options and skiptoken on generated useQuery hooks#3528
[draft] expose query options and skiptoken on generated useQuery hooks#3528nmokkenstorm wants to merge 1 commit intohey-api:mainfrom
Conversation
|
|
|
@nmokkenstorm is attempting to deploy a commit to the Hey API Team on Vercel. A member of the Team first needs to authorize it. |
🦋 Changeset detectedLatest commit: d6ebc7c The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
6d07fd5 to
cf8e859
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3528 +/- ##
==========================================
- Coverage 39.08% 39.03% -0.05%
==========================================
Files 495 495
Lines 18451 18495 +44
Branches 5479 5479
==========================================
+ Hits 7212 7220 +8
- Misses 9071 9103 +32
- Partials 2168 2172 +4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
@hey-api/codegen-core
@hey-api/json-schema-ref-parser
@hey-api/nuxt
@hey-api/openapi-ts
@hey-api/shared
@hey-api/types
@hey-api/vite-plugin
commit: |
|
@nmokkenstorm Why is it an optional configuration flag? Why not add it for everyone? |
|
@nandorojo will like this |
|
@nmokkenstorm I updated your description with linked issue |
habit to make it opt-in tbh. I think the skipToken is a breaking change too on type level and it also slightly increases the generated bundle size but I will check. |
|
@nmokkenstorm I didn't look at the code yet, stopped after seeing the configuration haha. If it's going to be breaking either way, I'd much rather deprecate the old approach because we wouldn't want new users to start with the flag disabled, realize one day they need to enable it, and face a lot of breaking changes. We can talk through it when you feel the pull request is more ready. I'm pretty sure there was another thread where we talked about skip tokens but can't find it, I'd like to ideally avoid another breaking change when that thread gets addressed |
I'll double check, I think it's definately doable to have it be backwards compatible without a breaking change. The useQuery/Mutation stuff was opt in so I stuck to the pattern but I think this can be done without losing ergonomics. I'll update the pr description and ping you if it's reviewable, I needed a remote public ref to do some internal testing with first anyways. Thanks for the feedback! |
7df42fb to
3007b3c
Compare
|
@nmokkenstorm Can you clarify what do you mean by "add useQuery hooks" in the title? React/Preact Query already support generating useQuery hooks so I'm confused what it's referencing |
its about having the generated useQuery hooks exist per entity, with queryoptions and skiptoken enabled. the reason it's named like that is because the original code/branch orginates from a fork that pre-dates the support we had in our project. still tinkering on this, nothing to see/review here yet! |
|
Just making sure we're aligned on the scope! I shall retreat once more |
3007b3c to
b40d1b5
Compare
b40d1b5 to
d6ebc7c
Compare
Builds on #3432 (useMutation hooks) to add
skipTokensupport andqueryOptionsoverride for the TanStack React Query plugin.Closes #2766