How to manually run query #222
Answered
by
AnJ-Github
AnJ-Github
asked this question in
Q&A
-
Hello, I'm trying to use Vue Query for handling login form. I'm trying to call I have something like this: <script setup lang="ts">
const useAuthQuery = (credentials: Credentials) => useQuery(['auth'], () => getAuthToken(credentials), {
refetchOnWindowFocus: false,
enabled: false,
});
const {
isFetching, data, isError, error, refetch,
} = useAuthQuery(credentials);
function onSubmit() {
refetch(); // error "This expression is not callable."
// ...
}
</script> Full error looks like this:
In React Query it seems to work fine: |
Beta Was this translation helpful? Give feedback.
Answered by
AnJ-Github
Jul 28, 2022
Replies: 1 comment
-
Ok, I got it.
|
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
AnJ-Github
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Ok, I got it.
useQuery
is returning refs, so instead ofrefetch()
it should berefetch.value()
.