After finishing a server call I want to refetch a specific query. The Apollo API has an option for mutations that lets you refetch but I want to refetch WITHOUT the mutation.
2 Answers
1
votes
Have you tried to manually firing a client.query ? https://www.apollographql.com/docs/react/essentials/queries.html#manual-query
The client variable is also available when you export your apolloClient.
-2
votes
if I have understood your question correctly, you could use QueryResult.refetch. here is some dirty code:
setInterval(() => {
props.data.refetch({
take: 10,
skip: 0,
}, );
}, 2000);
where data is the default name of a query result injected into the props of a component by graphql(...)