Skip to content
This repository has been archived by the owner on Jul 10, 2019. It is now read-only.

Refetch does not update loading to true #13

Closed
jbaxleyiii opened this issue Nov 13, 2017 · 1 comment
Closed

Refetch does not update loading to true #13

jbaxleyiii opened this issue Nov 13, 2017 · 1 comment

Comments

@jbaxleyiii
Copy link
Contributor

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);
@jbaxleyiii
Copy link
Contributor Author

➤ M S Morris commented:

Related issues:
apollographql/react-apollo#642
apollographql/apollo-client#1622
apollographql/apollo-client#2513

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

1 participant