We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
$fetch
useAsyncData
Hi @wobsoriano,
useQuery() leverages useAsyncData which is great for most use cases. However, I need raw data, because I use vue-query.
useQuery()
vue-query
The front page of the documentation site states that we can also use $fetch. How can I use $fetch instead of useAsyncData?
For example:
const fetcher = () => $client.hello.useQuery({ text: "client" }); const { isLoading, isError, data, error } = useQuery({ queryKey: ["test"], queryFn: fetcher });
I can use $client.hello.query({ text: "client" }) instead of useQuery, but I want to leverage $fetch.
$client.hello.query({ text: "client" })
useQuery
Many thanks,
The text was updated successfully, but these errors were encountered:
Hey @ozum, not sure if you’ve resolved this yet.
I believe you’re able to use .query(…) instead of .useQuery(…) which should give you access to the raw query without useAsyncData.
.query(…)
.useQuery(…)
It is outlined in the docs here https://trpc-nuxt.vercel.app/get-started/client
Sorry, something went wrong.
Thanks @qin-guan!
No branches or pull requests
Hi @wobsoriano,
useQuery()
leveragesuseAsyncData
which is great for most use cases. However, I need raw data, because I usevue-query
.The front page of the documentation site states that we can also use
$fetch
. How can I use$fetch
instead ofuseAsyncData
?For example:
I can use
$client.hello.query({ text: "client" })
instead ofuseQuery
, but I want to leverage$fetch
.Many thanks,
The text was updated successfully, but these errors were encountered: