react-apollo icon indicating copy to clipboard operation
react-apollo copied to clipboard

Clear fetch cache after creating new data

Open gregorybellencontre opened this issue 7 years ago • 0 comments

Hi, I'm trying to find the optimal fetch policy or something else, to clear the fetch cache after I create new records.

I have multiple dropdowns with names inside. I can search names in it (React Select) and I can add new names.

Currently, when I add a name in one dropdown, and search it in another dropdown, the useQuery hook returns the cache data rather than refetching it. So the new name can't be found.

Is there a way to clear the cache for this specific query, once I created a new name ?

gregorybellencontre avatar Nov 10 '19 15:11 gregorybellencontre