I have a feed list component and I have a search input above it component. Both components use the useLazyQuery hook.
const [getFeedPosts, { data, loading, error }] = useLazyQuery(GET_ALL_POSTS)
In the feed list, I manually trigger the getFeedPosts on mount and rendering a list of items.
In the search input component, I trigger getFeedPosts on click.
Is there a way I can override the cache after I receive results from the search? Ideally, the list component would re-render automatically.
The issue is that useLazyQuery doesn't provide "refetchQueries" function so I can not "refetch" after I get search results.
Otherwise, I would need some global state (redux, context API...) but from then on I have to manage the state manually if I like/update/delete post.