Open dominikklein opened 2 years ago
I experience the same behavior, but in my case a reason a little bit different. I use debounce with enabled option.
const { result, loading } = useQuery<{ items: ItemsConnection }>(
SEARCH_ITEMS,
() => ({ where: { name: { contains: toValue(searchTerm) } }, first }),
() => ({ debounce: 500, enabled: toValue(searchTerm) !== '' }),
);
The query triggers twice, the 1st time when it enables and then after the debounce period
Describe the bug When I use the debounce for my query, it triggered twice, once directly when I call the composable and then a second time after the debounce time is over.
Expected behavior The query should not be triggered twice. For me it should be triggered directly when I call the composable and then the debounce should be used when some update is happening.
Versions vue: 3.2.40 @vue/apollo-composable: "^4.0.0-beta.1", @apollo/client: ^3.6.9