React Data overridden in Data table after filtering data Tech stack used: React typescript and GraphQL (apollo client).
Above issue is resolved by the below given code (React typescript):
const defaultOptions: DefaultOptions = {
watchQuery: {
fetchPolicy: 'no-cache',
errorPolicy: 'all',
},
query: {
fetchPolicy: 'no-cache',
errorPolicy: 'all',
},
mutate: {
errorPolicy: 'all',
},
};
return new ApolloClient({
uri: 'http://example/graphql',
cache: new InMemoryCache(),
defaultOptions: defaultOptions
})