0

I am new to graphql and apollo. I have a useMutation query which on completion perform a refetchQueries operation of 2 other queries. How to write a unit for refetchQueries specific, so that if I remove the refetchQueries code my test should fail.

I am using vitest, vite, vue3, apollo, graphql, vue-testing-library and msw for mocking.

Note: The queries which I want to perform in refetchQueries will reflect data change in some other component and will not be visible in the current component, so the assertion which I am looking something like this:

expect(getQuery1).toHaveBeenCalled()

Is it possible to perform this assertion?

0 Answers0