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(vue-query): export InitialQueryOptions types #7720

Merged
merged 1 commit into from
Jul 16, 2024

Conversation

andylizi
Copy link
Contributor

These types are exported from react-query. Not exporting them will cause Typescript to complain when using queryOptions:

// From the official Query Options example:
// https://tanstack.com/query/latest/docs/framework/vue/guides/query-options
import { queryOptions } from '@tanstack/vue-query'

export function groupOptions(id: number) {
  return queryOptions({
    queryKey: ['groups', id],
    queryFn: () => fetchGroups(id),
    staleTime: 5 * 1000,
  })
}

ts(2742) The inferred type of 'groupOptions' cannot be named without a reference to '../node_modules/@tanstack/vue-query/build/modern/useQuery-JLP2sK49'. This is likely not portable. A type annotation is necessary.

This is a bug similar to #6318, the latter of which is about useQuery. This PR fixes queryOptions.

Copy link

nx-cloud bot commented Jul 16, 2024

☁️ Nx Cloud Report

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

Copy link

pkg-pr-new bot commented Jul 16, 2024

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

commit: 97f6a92

@tanstack/angular-query-devtools-experimental

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

@tanstack/angular-query-experimental

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

@tanstack/eslint-plugin-query

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

@tanstack/query-async-storage-persister

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

@tanstack/query-broadcast-client-experimental

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

@tanstack/query-core

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

@tanstack/query-devtools

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

@tanstack/query-persist-client-core

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

@tanstack/query-sync-storage-persister

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

@tanstack/react-query

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

@tanstack/react-query-devtools

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

@tanstack/react-query-next-experimental

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

@tanstack/react-query-persist-client

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

@tanstack/solid-query

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

@tanstack/solid-query-devtools

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

@tanstack/solid-query-persist-client

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

@tanstack/svelte-query

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

@tanstack/svelte-query-devtools

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

@tanstack/svelte-query-persist-client

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

@tanstack/vue-query

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

@tanstack/vue-query-devtools

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


templates

@DamianOsipiuk DamianOsipiuk merged commit a3f5a0a into TanStack:main Jul 16, 2024
5 checks passed
@andylizi andylizi deleted the fix-vue-export branch July 17, 2024 10:17
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.

None yet

2 participants