I use ApolloClient. Need to get know if the mutation was called. Is there a watcher in GraphQL or hook that can take the name of the mutation and as a result return the result of the mutation or say with what variables it was called, or if it was simply called?
The purpose isn't just to know if it was called (in browser devtools or etc) - I need to use that information to writhe frontend logic.
The best way to track if a mutation/query is called is via the browser network tab. You'll be able to see all of the network requests with the parameters that were sent. In browser developer tools -> network tab.
Click on the Fetch/XRH filter as well to limit the results.
If there is an action that you want to do after the mutation is called, onCompleted will be your best bet.
const [muationHere] = useMutation(
MUTATION,
{
onCompleted(data) {
console.log(data);
}
}
);