Open mathieuCatapulpe opened 8 months ago
i have this issue too!
:sob: same issue any update? Because useQuery
fire onResult
twice after refreshed page. You can edit like this
const pageSize = 11;
const page = ref(1)
const tableData = ref<PaginatedSystemSetting>(emptyPaginatedSystemSetting)
const { data, status } = await useLazyAsyncData(async () => {
await handleCurrentPageChange(1);
})
const handleCurrentPageChange = async (val: number) => {
page.value = val;
useQuery<{ data: PaginatedSystemSetting }>(findAllQuery, {
input: { page: page.value, perPage: pageSize },
}, {
fetchPolicy: 'network-only',
prefetch: false,
}).onResult((value) => {
if (value.loading == false) {
tableData.value = value.data.data;
}
});
}
Environment
Describe the bug
After a successful query using either
useAsyncQuery
oruseQuery
I can console.log my result, but when trying to access result.value it returns null as shown in the example bellowExpected behaviour
Being able to access result.value
Reproduction
No response
Additional context
Also tried :
useQuery
anduseAsyncQuery
nuxt dev
prefetch : false
parameter to the queryLogs
No response