I’m having a hard time figuring out how to simply refresh the cache of say a “Posts” table after I create a new Post.
I’m not sure if optimistic updates are required? I really just want to say client.invalidateQuery("getPosts")
and be done with it. I also don’t want to clear the entire apollo cache if I can help it.
For example, the user sees a list of posts and a create button. They click create and it goes to the create page. Once they click submit, it creates a new Post and navigates back to the list of Posts and their new post is not showing. I would like it to do a re-fetch at this time.
I’m using the new Apollo React 2.1 syntax as well. Thanks in advance!