How to use useQuery from inside of a function? #1359
martinszeltins
started this conversation in
General
Replies: 1 comment 2 replies
-
|
Check out of the docs for useLazyQuery: https://v4.apollo.vuejs.org/guide-composable/query.html#lazy-query Basically: |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
How can I use
useQueryfrom inside of a function and still have access toresultandloadingin my template? For example here I do not have access toresultsorloadingfrom my template because they are defined withing theloadDatafunction and I need to load the data only when the user clicks the button.Also, ideally, I want to move my
useQueryto a different file likeusersApi.jsand then callusersApi.getUsers()Beta Was this translation helpful? Give feedback.
All reactions