Skip to content

Instantly share code, notes, and snippets.

@luandevpro luandevpro/Post.js
Created Jun 22, 2019

Embed
What would you like to do?
<button
onClick={() =>
data.fetchMore({
variables: {
offset: data.data.post.length,
},
updateQuery: (prev, { fetchMoreResult }) => {
if (!fetchMoreResult) return prev;
return Object.assign({}, prev, {
post: [...prev.post, ...fetchMoreResult.post],
});
},
})
}
>
refetch
</button>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.