2

React Data overridden in Data table after filtering data Tech stack used: React typescript and GraphQL (apollo client).

  • We have used react-data-table-component, mui/material. In this both modules data is overridden after data is filtered.
  • Not getting any solution for this issue, If anyone can help regarding this issue.

1 Answers1

0

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
    })