I am trying to create Nuxt application with GraphQL + Apollo Server connection. I'm just starting my Nuxt practice and I have a problem. When the page is reloaded, the date is retrieved at the start via useMutation:
const { mutate: postPublish, loading } = useMutation(PUBLISH_POST, {
variables: {
postId: props.id,
},
refetchQueries: [
{
query: GET_PROFILE,
variables: {
userId: params.id,
},
},
],
});
When switching between pages, I use the recommended <NuxtLink></NuxtLink>;
but when switching pages in this way, useMutation does not trigger on startup.
Everything works when I'm using <a></a> tag.
Can someone explain to me why it works like this and how to remedy it by staying with <NuxtLink></NuxtLink>