Created
September 15, 2020 08:08
-
-
Save Yassir4/321e8a1debdb96a5e3d1ac8d92ba1203 to your computer and use it in GitHub Desktop.
Repositories
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// ... | |
const onUpdate = (prev, { fetchMoreResult }) => { | |
if (!fetchMoreResult) return prev | |
const { pageInfo } = fetchMoreResult.organization.repositories | |
const nodes = [ | |
...prev.organization.repositories.nodes, | |
...fetchMoreResult.organization.repositories.nodes, | |
] | |
return Object.assign({}, prev, { | |
organization: { | |
__typename: prev.organization.__typename, | |
repositories: { | |
__typename: prev.organization.repositories.__typename, | |
pageInfo, | |
nodes, | |
}, | |
}, | |
}) | |
} | |
// ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment