So Im trying to use client.refetchQueries. This is my query:
const {
loading,
data: resp,
error,
refetch,
fetchMore,
} = useQuery<any, getCoursesParams>(getCourses, {
variables: {
count: 5,
offsetId: "",
filter: {},
},
fetchPolicy: "cache-and-network",
nextFetchPolicy: "cache-first",
errorPolicy: "ignore",
notifyOnNetworkStatusChange: true,
})
And Im refetching like this:
const refetchQv = async () => {
const result = await client.refetchQueries({
include: [getCourses],
updateCache: (cache) => {
cache.evict({ fieldName: "courses" });
},
});
};
I get the result while refetching, but I dont want this result, I want the original query to be refetched, with its loading state.