Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(*): infer data type correctly when conditional skipToken is passed to useQueries #7150

Merged
merged 5 commits into from Mar 25, 2024

Conversation

gwansikk
Copy link
Contributor

@gwansikk gwansikk commented Mar 21, 2024

Hello, I'm a huge enthusiast of TanStack-query! 👋

I've fixed the issue. closes: #7035
In my quest for a better solution, I've explored several alternatives, yet this appears to be the best I could come up with. Frankly, I don't find this fix particularly elegant or "cool", so I'm open to suggestions for enhancement.

I've run the test and everything checks out, so I'm sending over this PR.

Thank you!

Copy link

vercel bot commented Mar 21, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
query ⬜️ Ignored (Inspect) Visit Preview Mar 25, 2024 9:32am

Copy link

codesandbox-ci bot commented Mar 21, 2024

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 5c5a233:

Sandbox Source
@tanstack/query-example-angular-basic Configuration
@tanstack/query-example-react-basic-typescript Configuration
@tanstack/query-example-solid-basic-typescript Configuration
@tanstack/query-example-svelte-basic Configuration
@tanstack/query-example-vue-basic Configuration

Copy link

nx-cloud bot commented Mar 22, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 5c5a233. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


✅ Successfully ran 2 targets

Sent with 💌 from NxCloud.

@TkDodo
Copy link
Collaborator

TkDodo commented Mar 22, 2024

thank you. Can you please fix the conflicts and also port this fix to the other adapters that have useQueries or createQueries?

@gwansikk gwansikk changed the title fix(reat-query): infer data type correctly when conditional skipToken is passed to useQueries fix(*): infer data type correctly when conditional skipToken is passed to useQueries Mar 22, 2024
@gwansikk
Copy link
Contributor Author

Thank you for the review. I have also applied it to Angular, Solid, Svelte, Vue! 🙌

@manudeli
Copy link
Contributor

@TkDodo test:format error will be gone after merging #7163

@TkDodo TkDodo merged commit a559c48 into TanStack:main Mar 25, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

useQueries + skipToken looses .data type inference
3 participants