feat(subs): subscribe to branch and commit changes
- branch created, branch updated, branch deleted, and commit updated - for more seamless user experience!
This commit is contained in:
@@ -318,9 +318,7 @@ export default {
|
||||
}
|
||||
`,
|
||||
variables() {
|
||||
return {
|
||||
id: this.savedStream.id
|
||||
}
|
||||
return { id: this.savedStream.id }
|
||||
},
|
||||
result() {
|
||||
this.$apollo.queries.stream.refetch()
|
||||
@@ -333,9 +331,7 @@ export default {
|
||||
}
|
||||
`,
|
||||
variables() {
|
||||
return {
|
||||
streamId: this.savedStream.id
|
||||
}
|
||||
return { streamId: this.savedStream.id }
|
||||
},
|
||||
result(commitInfo) {
|
||||
this.$apollo.queries.stream.refetch()
|
||||
@@ -344,6 +340,58 @@ export default {
|
||||
message: `New commit on ${this.stream.name} @ ${commitInfo.data.commitCreated.branchName}`
|
||||
})
|
||||
}
|
||||
},
|
||||
commitUpdated: {
|
||||
query: gql`
|
||||
subscription($id: String!) {
|
||||
commitUpdated(streamId: $id)
|
||||
}
|
||||
`,
|
||||
variables() {
|
||||
return { id: this.savedStream.id }
|
||||
},
|
||||
result() {
|
||||
this.$apollo.queries.stream.refetch()
|
||||
}
|
||||
},
|
||||
branchCreated: {
|
||||
query: gql`
|
||||
subscription($id: String!) {
|
||||
branchCreated(streamId: $id)
|
||||
}
|
||||
`,
|
||||
variables() {
|
||||
return { id: this.savedStream.id }
|
||||
},
|
||||
result() {
|
||||
this.$apollo.queries.stream.refetch()
|
||||
}
|
||||
},
|
||||
branchDeleted: {
|
||||
query: gql`
|
||||
subscription($id: String!) {
|
||||
branchDeleted(streamId: $id)
|
||||
}
|
||||
`,
|
||||
variables() {
|
||||
return { id: this.savedStream.id }
|
||||
},
|
||||
result() {
|
||||
this.$apollo.queries.stream.refetch()
|
||||
}
|
||||
},
|
||||
branchUpdated: {
|
||||
query: gql`
|
||||
subscription($id: String!) {
|
||||
branchUpdated(streamId: $id)
|
||||
}
|
||||
`,
|
||||
variables() {
|
||||
return { id: this.savedStream.id }
|
||||
},
|
||||
result() {
|
||||
this.$apollo.queries.stream.refetch()
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user