diff --git a/src/relations.js b/src/relations.js index b8458f3..ca3ed28 100644 --- a/src/relations.js +++ b/src/relations.js @@ -400,6 +400,7 @@ MqttSource.prototype.log = async function(scanClassId) { sql = `${sql} VALUES (?,?);` params = [host.id, result.lastID] await this.constructor.executeUpdate(sql, params) + this.pubsub.publish('mqttUpdate', { mqttUpdate: this.mqtt.service }) } resolve() }) diff --git a/src/resolvers/Subscription/index.js b/src/resolvers/Subscription/index.js index 9c3bd7f..7817799 100644 --- a/src/resolvers/Subscription/index.js +++ b/src/resolvers/Subscription/index.js @@ -1,5 +1,7 @@ const tag = require('./tag') +const mqttUpdate = require('./mqttUpdate') module.exports = { + ...mqttUpdate, ...tag } diff --git a/src/schema.graphql b/src/schema.graphql index 792a70b..17cec34 100644 --- a/src/schema.graphql +++ b/src/schema.graphql @@ -356,5 +356,6 @@ type Mutation { } type Subscription { - tagUpdate: Tag + tagUpdate: Tag, + mqttUpdate: Service } \ No newline at end of file