Apollo Client cache merging previous (from other route) and new results when using browser back button

Viewed 50

I am using Apollo Client fetchMore function and configured the Apollo Client cache:

The Apollo Client typePolicies configured like:

typePolicies: {
    NodesTypeOne: {
     keyFields: [],
     fields: {
      nodes: offsetLimitPagination(),
     },
    },
    NodesTypeTwo: {
     keyFields: [],
     fields: {
      nodes: offsetLimitPagination(),
     },
    },,
  },

When I use the browser Back button (so it'a navigating back to the overview page, without refreshing the page) and navigate from this overview page to another Node detail-page, it's merging the results from the previous route and the current route?

In the useQuery hook I am using:

notifyOnNetworkStatusChange: true,

Somehow, when I hit the Back button, I have to reset the cache or something?

How do I have to solve this issue?

0 Answers
Related