Skip to content
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.

Refetch does not update loading to true #1331

Closed
wojcikiewiczm opened this issue Nov 9, 2017 · 4 comments
Closed

Refetch does not update loading to true #1331

wojcikiewiczm opened this issue Nov 9, 2017 · 4 comments

Comments

@wojcikiewiczm
Copy link

wojcikiewiczm commented Nov 9, 2017

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);
@msmfsd
Copy link

msmfsd commented Nov 10, 2017

@jaredly
Copy link

jaredly commented Nov 17, 2017

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

@bxt
Copy link

bxt commented Dec 18, 2018

You could try setting notifyOnNetworkStatusChange to true.

@rosskevin
Copy link
Contributor

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants