Skip to content

fix(query-core): widen QueriesObserver queries type (#7446)#7492

Merged
TkDodo merged 4 commits intoTanStack:mainfrom
yannickcr:fix-queriesobserver-type
Jul 17, 2024
Merged

fix(query-core): widen QueriesObserver queries type (#7446)#7492
TkDodo merged 4 commits intoTanStack:mainfrom
yannickcr:fix-queriesobserver-type

Conversation

@yannickcr
Copy link
Copy Markdown
Contributor

Widen the QueriesObserver queries type so we can assign UseQueryOptions to QueryObserverOptions.

The result from the queryOptions helper can now be passed to QueriesObserver.

This align the QueriesObserver behavior with QueryObserver (that already accepts UseQueryOptions).

Caveat: The return type from QueriesObserver will be QueriesObserver<QueryObserverResult[]>, it means that the QueryObserverResult data type will be unknown. As discussed in #7446 (comment) it has been decided that it was an acceptable compromise for now.

@vercel
Copy link
Copy Markdown

vercel bot commented May 29, 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 Jun 7, 2024 3:09pm

@codesandbox-ci
Copy link
Copy Markdown

codesandbox-ci bot commented May 29, 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 8f74190:

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

@TkDodo
Copy link
Copy Markdown
Collaborator

TkDodo commented May 31, 2024

can you add a type test for your situation please?

@nx-cloud
Copy link
Copy Markdown

nx-cloud bot commented May 31, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 05e887d. 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.

Widen the `QueriesObserver` queries type so we can assign `UseQueryOptions` to `QueryObserverOptions`.

The result from the `queryOptions` helper can now be passed to `QueriesObserver`.
@yannickcr yannickcr force-pushed the fix-queriesobserver-type branch from cb7c9c4 to 8f74190 Compare June 7, 2024 15:09
@TkDodo TkDodo linked an issue Jul 17, 2024 that may be closed by this pull request
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Jul 17, 2024

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

commit: 05e887d

@tanstack/angular-query-devtools-experimental

npm i https://pkg.pr.new/@tanstack/angular-query-devtools-experimental@7492

@tanstack/angular-query-experimental

npm i https://pkg.pr.new/@tanstack/angular-query-experimental@7492

@tanstack/eslint-plugin-query

npm i https://pkg.pr.new/@tanstack/eslint-plugin-query@7492

@tanstack/query-async-storage-persister

npm i https://pkg.pr.new/@tanstack/query-async-storage-persister@7492

@tanstack/query-broadcast-client-experimental

npm i https://pkg.pr.new/@tanstack/query-broadcast-client-experimental@7492

@tanstack/query-core

npm i https://pkg.pr.new/@tanstack/query-core@7492

@tanstack/query-devtools

npm i https://pkg.pr.new/@tanstack/query-devtools@7492

@tanstack/query-persist-client-core

npm i https://pkg.pr.new/@tanstack/query-persist-client-core@7492

@tanstack/query-sync-storage-persister

npm i https://pkg.pr.new/@tanstack/query-sync-storage-persister@7492

@tanstack/react-query

npm i https://pkg.pr.new/@tanstack/react-query@7492

@tanstack/react-query-devtools

npm i https://pkg.pr.new/@tanstack/react-query-devtools@7492

@tanstack/react-query-next-experimental

npm i https://pkg.pr.new/@tanstack/react-query-next-experimental@7492

@tanstack/react-query-persist-client

npm i https://pkg.pr.new/@tanstack/react-query-persist-client@7492

@tanstack/solid-query

npm i https://pkg.pr.new/@tanstack/solid-query@7492

@tanstack/solid-query-devtools

npm i https://pkg.pr.new/@tanstack/solid-query-devtools@7492

@tanstack/solid-query-persist-client

npm i https://pkg.pr.new/@tanstack/solid-query-persist-client@7492

@tanstack/svelte-query

npm i https://pkg.pr.new/@tanstack/svelte-query@7492

@tanstack/svelte-query-devtools

npm i https://pkg.pr.new/@tanstack/svelte-query-devtools@7492

@tanstack/svelte-query-persist-client

npm i https://pkg.pr.new/@tanstack/svelte-query-persist-client@7492

@tanstack/vue-query

npm i https://pkg.pr.new/@tanstack/vue-query@7492

@tanstack/vue-query-devtools

npm i https://pkg.pr.new/@tanstack/vue-query-devtools@7492


templates

@TkDodo
Copy link
Copy Markdown
Collaborator

TkDodo commented Jul 17, 2024

prettier fails now 😭

@TkDodo TkDodo merged commit a87c2fe into TanStack:main Jul 17, 2024
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.

Unable to pass queryOptions to QueriesObserver (TypeScript error)

2 participants