Open gouldingken opened 1 year ago
https://www.apollographql.com/docs/react/data/subscriptions/
Reference TheMain.vue for an example use case we would want to replicate.
apollo: { $subscribe: { userStreamAdded: { query: gql` subscription userStreamAdded { userStreamAdded } `, result({ data }) { if (!data || !data.userStreamAdded) return if (this.$route.params.streamId === data.userStreamAdded.id) return this.$eventHub.$emit('notification', { text: `You've got a new stream!`, action: { name: 'View Stream', to: `/streams/${data.userStreamAdded.id}` } }) }, skip() { return !this.isLoggedIn } } } },
https://www.apollographql.com/docs/react/data/subscriptions/
Reference TheMain.vue for an example use case we would want to replicate.