Skip to content

Commit

Permalink
refactor(proposal-list): remove gql sub
Browse files Browse the repository at this point in the history
refactor(proposal-list): remove gql sub
  • Loading branch information
arsenijesavic authored Mar 19, 2024
2 parents d44c561 + 2dde32a commit e482c14
Showing 1 changed file with 50 additions and 50 deletions.
100 changes: 50 additions & 50 deletions src/pages/proposals/ProposalList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -400,32 +400,32 @@ export default {
}
},
fetchPolicy: 'no-cache',
pollInterval: 1000, // TODO: Swap with subscribe once dgraph is ready
subscribeToMore: {
document: require('~/query/proposals/dao-proposals-active-vote-subs.gql'),
variables() {
return {
docId: this.selectedDao.docId,
// first: this.pagination.first,
// offset: 0,
user: this.account
}
},
skip() { return !this.selectedDao?.docId },
updateQuery: (previousResult, { subscriptionData }) => {
if (!subscriptionData?.data) {
return previousResult
}
if (!previousResult?.data) {
return undefined
}
subscriptionData.data.queryDao[0].proposal = [
...previousResult.data.queryDao[0].proposal,
...subscriptionData.data.queryDao[0].proposal
]
return subscriptionData
}
}
pollInterval: 1000 // TODO: Swap with subscribe once dgraph is ready
// subscribeToMore: {
// document: require('~/query/proposals/dao-proposals-active-vote-subs.gql'),
// variables() {
// return {
// docId: this.selectedDao.docId,
// // first: this.pagination.first,
// // offset: 0,
// user: this.account
// }
// },
// skip() { return !this.selectedDao?.docId },
// updateQuery: (previousResult, { subscriptionData }) => {
// if (!subscriptionData?.data) {
// return previousResult
// }
// if (!previousResult?.data) {
// return undefined
// }
// subscriptionData.data.queryDao[0].proposal = [
// ...previousResult.data.queryDao[0].proposal,
// ...subscriptionData.data.queryDao[0].proposal
// ]
// return subscriptionData
// }
// }
},
stagedProposals: {
query: gql`query stageProposals($docId: String!, $first: Int!, $offset: Int!) { ${STAGED_PROPOSALS_QUERY} }`,
Expand All @@ -441,30 +441,30 @@ export default {
},
errorPolicy: 'all',
fetchPolicy: 'no-cache',
// pollInterval: 1000, // TODO: Swap with subscribe once dgraph is ready
subscribeToMore: {
document: gql`subscription stageProposals($docId: String!, $first: Int, $offset: Int) { ${STAGED_PROPOSALS_QUERY} }`,
skip() { return !this.selectedDao?.docId },
variables() {
return {
docId: this.selectedDao.docId,
user: this.account
}
},
updateQuery: (previousResult, { subscriptionData }) => {
if (!subscriptionData?.data) {
return previousResult
}
if (!previousResult?.data) {
return undefined
}
subscriptionData.data.queryDao[0].stagingprop = [
...previousResult.data.queryDao[0].stagingprop,
...subscriptionData.data.queryDao[0].stagingprop
]
return subscriptionData
}
}
pollInterval: 1000 // TODO: Swap with subscribe once dgraph is ready
// subscribeToMore: {
// document: gql`subscription stageProposals($docId: String!, $first: Int, $offset: Int) { ${STAGED_PROPOSALS_QUERY} }`,
// skip() { return !this.selectedDao?.docId },
// variables() {
// return {
// docId: this.selectedDao.docId,
// user: this.account
// }
// },
// updateQuery: (previousResult, { subscriptionData }) => {
// if (!subscriptionData?.data) {
// return previousResult
// }
// if (!previousResult?.data) {
// return undefined
// }
// subscriptionData.data.queryDao[0].stagingprop = [
// ...previousResult.data.queryDao[0].stagingprop,
// ...subscriptionData.data.queryDao[0].stagingprop
// ]
// return subscriptionData
// }
// }
},
proposalsCount: {
Expand Down

0 comments on commit e482c14

Please sign in to comment.