React-apollo: Refetch does not update loading to true

Created on 9 Nov 2017  路  4Comments  路  Source: apollographql/react-apollo

Hello,

when I use refetech loading is not updated to true and after fetch to false. Is it issue or I'm doing something wrong?

const FoldersContainerWithGraphQL = compose(
    withApollo,
    graphql(GET_FOLDERS_REVIEW, {
        options: () => {
            return {
                variables: {limit: FOLDERS_PER_PAGE, offset: 0}
            };
        },
        props: ({data, data: {fetchMore}}) => {
            return {
                folders: {
                    ...data,
                    loadMoreEntries(pageNumber) {
                        return fetchMore({
                            variables: {
                                offset: FOLDERS_PER_PAGE * pageNumber
                            },
                            updateQuery: (previousResult, {fetchMoreResult}) => {
                                if (!fetchMoreResult) {
                                    return previousResult;
                                }
                                return fetchMoreResult;
                            }
                        });
                    }
                }
            };
        }
    })
)(FoldersContainer);

Most helpful comment

Looks like refetch doesn't update the component at all? I'm having to manage that state myself

All 4 comments

Looks like refetch doesn't update the component at all? I'm having to manage that state myself

You could try setting notifyOnNetworkStatusChange to true.

Was this page helpful?
0 / 5 - 0 ratings