Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Could you add QueryObserver export?

See original GitHub issue

So, I am in a situation where I need to use query result outside a composable function or setup. According to the QueryObserver api, the way to achieve that would be -

import { QueryObserver } from 'vue-query';
import { queryClient } from 'myQueryClient';

const classesObserver = new QueryObserver(queryClient, { queryKey: ['classes', dependencies] });
const classesData = classesObserver.getCurrentResult().data;

Now, difference between using query observer’s getCurrentResult vs using query client’s getQueryData/getQueryState would be query observer will return the actual data which is cached along with its transformation done using select option. Whereas, queryClient’s getQueryData/getQueryState will return just the response data.

So, could you possibly add QueryObserver to the vue-query exports?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

onkarj422commented, May 18, 2021

Works for me, maybe you have another registry set-up?

Yeah i have another registry setup, but how do i update then?

Edit: My other registry took time to update its list

DamianOsipiukcommented, May 17, 2021

Works for me, maybe you have another registry set-up?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to observe cache with QueryObserver (v3) #3292
I 'm trying to observe, from a component, data fetched and cached by another component, but I can't make it work. Upon authentication,...
Read more >
Migrating to React Query 3 - TanStack
You must create your own via new QueryClient() or new QueryCache() (which you can then pass to new QueryClient({ queryCache }) ) ...
Read more >
What's new in React Query 3 - LogRocket Blog
In this post, you can learn what React Query is and what new features have ... Create a client const queryClient = new...
Read more >
Export a database object to another Access database
You can export a table, query, form, report, macro, or module from one Access database to another. When you export an object, Access...
Read more >
Exporter | Querybook
To ensure Querybook more generalizable, all exporters are not included by default. If you want to add an exporter, please do so through...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found