Closed skunal8197 closed 2 years ago
relevant code
subscribeToMore({
document: SUBSCRIBE_BLOCK_CHANGES,
variables: { fetchPolicy: "cache-and-network", num: limit, offset: (currentPage - 1) * limit },
updateQuery: (prev, { newData }) => {
if (!newData) return prev;
const newBlock = newData.blocks[0]
return Object.assign({}, prev, {
blocks: [newBlock, ...prev.blocks]
});
}
})
test with @DenisIvanov26