Describe the bug
Passing a DocumentNode to refetchQueries as parameter does not trigger an update for the query, whereas passing the name of the query does. As shown here both should be supported.
To Reproduce
Given the example component below:
If you call someMutation(), while passing the query name in refetchQueries, the console will show the useQuery triggered message. Whereas when {query: EXAMPLE_QUERY} is passed the console will not show the message.
Example component:
<script>
const EXAMPLE_QUERY = gql`
query example_query {
doSomething {
id
name
}
}`;
export default {
name: "test",
mounted() {
const { onResult } = useQuery(EXAMPLE_QUERY);
onResult((result) => {
console.log("useQuery triggered");
});
},
methods: {
someMutation() {
const { mutate: mutationCallback } = useMutation(MUTATION_QUERY, {
refetchQueries: [
// THIS DOES NOT WORK
// {query: EXAMPLE_QUERY}
// THIS WORKS
'example_query'
]
});
mutationCallback().then(() => {
console.log("mutation executed");
});
}
}
}
</script>
Expected behavior
Both the query name and DocumentNode should trigger useQuery to update.
Describe the bug Passing a
DocumentNode
torefetchQueries
as parameter does not trigger an update for the query, whereas passing the name of the query does. As shown here both should be supported.To Reproduce
Given the example component below: If you call
someMutation()
, while passing the query name inrefetchQueries
, the console will show theuseQuery triggered
message. Whereas when{query: EXAMPLE_QUERY}
is passed the console will not show the message.Example component:
Expected behavior Both the query name and
DocumentNode
should triggeruseQuery
to update.Versions vue: 3.2.41 @vue/apollo-composable: 4.0.0-beta.1 @apollo/client: 3.7.1