{"_id":"@blueeast/graphql-mqtt-subscriptions","_rev":"7-3eef77c14031b3ce576705cf201e10e4","name":"@blueeast/graphql-mqtt-subscriptions","dist-tags":{"latest":"2.1.7"},"versions":{"2.1.3":{"name":"@blueeast/graphql-mqtt-subscriptions","version":"2.1.3","description":"A graphql-subscriptions PubSub Engine using mqtt protocol","main":"dist/index.js","repository":{"type":"git","url":"git+https://github.com/BlueEastCode/graphql-mqtt-subscriptions.git"},"keywords":["graphql","mqtt","apollo","subscriptions","blueeast"],"author":{"name":"David Yahalomi, Abdul Ghaffar","email":"gmithoog@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/BlueEastCode/graphql-mqtt-subscriptions/issues"},"homepage":"https://github.com/BlueEastCode/graphql-mqtt-subscriptions","scripts":{"compile":"tsc --noUnusedParameters --noUnusedLocals","pretest":"true","test":"true","posttest":"npm run lint","lint":"tslint ./src/**/*.ts","watch":"tsc -w","testonly":"mocha --reporter spec --full-trace ./dist/test/tests.js ","integration":"npm run compile && mocha --reporter spec --full-trace ./dist/test/integration-tests.js ","benchmark":"npm run compile && mocha --reporter spec --full-trace ./dist/test/benchmark.js ","coverage":"node ./node_modules/istanbul/lib/cli.js cover _mocha -- --full-trace ./dist/test/tests.js","postcoverage":"remap-istanbul --input coverage/coverage.raw.json --type lcovonly --output coverage/lcov.info","prepublish":"npm run test"},"dependencies":{"graphql-subscriptions":"^0.4.2","iterall":"^1.1.1","mqtt":"^2.3.0"},"devDependencies":{"@types/chai":"^3.4.34","@types/chai-as-promised":"0.0.30","@types/graphql":"^0.9.0","@types/mocha":"^2.2.33","@types/node":"7.0.18","@types/simple-mock":"0.0.27","chai":"^3.5.0","chai-as-promised":"^6.0.0","graphql":"^0.10.1","istanbul":"1.0.0-alpha.2","mocha":"^3.0.0","remap-istanbul":"^0.9.5","simple-mock":"^0.7.0","tslint":"^5.2.0","typescript":"^2.3.4"},"typings":"dist/index.d.ts","typescript":{"definition":"dist/index.d.ts"},"gitHead":"298d9581787be6222aed102a767b388216419cc8","_id":"@blueeast/graphql-mqtt-subscriptions@2.1.3","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"bjavaid","email":"javaidbabar@gmail.com"},"dist":{"integrity":"sha512-CFReaX1Ua9lnQHxFZC1XHS/ijYw+FhGV+WHpfdkxBlbnRwXpE2DKSwuXkwU/6TBpx1sH5ImzYXt8FqpUlT1vGA==","shasum":"3ca8ae920670646a308904716a5221829eb12bc0","tarball":"https://registry.npmjs.org/@blueeast/graphql-mqtt-subscriptions/-/graphql-mqtt-subscriptions-2.1.3.tgz","fileCount":18,"unpackedSize":155532,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbKPmdCRA9TVsSAnZWagAACt8P/R2n0GqywM56c2vc/Uhw\n1IwIFqOs7/lLLKho/NAi1W5/udTJu0Dw/vSNj7lhlTfIJS9rItmb0ziNDrCR\niCnObAmdrVjwkDUTCN6oHnUtQ74PVR1LlRHsEFvmDxPmi3P4cG7CqU4oknog\n2UyRcKE4k/14k/ffJ4+H0R8rwH1Q8I01M/VcRE6AUJsJVmoSVQjeCl+3t0ld\njkVQlu3KbjHCI5v0WP5s2ZnVG0YmHQlQl845eb6VHr0JBF2oE0KY53uEReUH\nC3KJRekKji0+wEfKxRfuEdb5+s4b+cZ1Wu541XwAuh3ZD6C/XKqZqadtgEtz\nnqqsi1Nfyxh5h99igAAReZAUB8BzWBonlxGs/CotgYpGDwqam9jDRwEsbUo9\n6mSPwhmCnPsgy2+PFP+KdDIjukuYw4IWO5hpzpF0DlWLw9ry7wj8evkmRPHA\nXJSdhey/GUs4UISC4077aXnuYt1SfXctnZ7o1swTizeD4lkPhgu4A3disFpY\nKja5UnDldZU50y2mMPHoZqCX9ugpqfkrXaxUqkPZwgUULZ1vUZv7bg51GApN\ndaBd4qa3zciFOxBQleoSJP7pboHBB5cGfZgGPO+ZZD8HhSuBISare1yN5Q13\nkZUiKG9HB0fIId8j3JnPv879mx+1GS4VcNdsQ0PcYleFIeCO0n5dLbkdMz2V\nYBZb\r\n=11Gz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQChwtoAvYIK0wLmB9zEWLH9y+aohSuFgNkNsAGHFMeDCQIgFpnkYLQZieqPwWg6HvawNxvY/rH2pILTKr/yKU1L300="}]},"maintainers":[{"name":"artalat","email":"rehman.talat@gmail.com"},{"name":"bjavaid","email":"javaidbabar@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-mqtt-subscriptions_2.1.3_1529411996305_0.5742632318783831"},"_hasShrinkwrap":false},"2.1.5":{"name":"@blueeast/graphql-mqtt-subscriptions","version":"2.1.5","description":"A graphql-subscriptions PubSub Engine using mqtt protocol","main":"dist/index.js","repository":{"type":"git","url":"git+https://github.com/BlueEastCode/graphql-mqtt-subscriptions.git"},"keywords":["graphql","mqtt","apollo","subscriptions","blueeast"],"files":["dist"],"author":{"name":"David Yahalomi, Abdul Ghaffar","email":"gmithoog@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/BlueEastCode/graphql-mqtt-subscriptions/issues"},"homepage":"https://github.com/BlueEastCode/graphql-mqtt-subscriptions","scripts":{"compile":"tsc --noUnusedParameters --noUnusedLocals","pretest":"true","test":"true","posttest":"npm run lint","lint":"tslint ./src/**/*.ts","watch":"tsc -w","testonly":"mocha --reporter spec --full-trace ./dist/test/tests.js ","integration":"npm run compile && mocha --reporter spec --full-trace ./dist/test/integration-tests.js ","benchmark":"npm run compile && mocha --reporter spec --full-trace ./dist/test/benchmark.js ","coverage":"node ./node_modules/istanbul/lib/cli.js cover _mocha -- --full-trace ./dist/test/tests.js","postcoverage":"remap-istanbul --input coverage/coverage.raw.json --type lcovonly --output coverage/lcov.info","prepublish":"npm run test"},"dependencies":{"graphql-subscriptions":"^0.4.2","iterall":"^1.1.1","mqtt":"^2.3.0"},"devDependencies":{"@types/chai":"^3.4.34","@types/chai-as-promised":"0.0.30","@types/graphql":"^0.9.0","@types/mocha":"^2.2.33","@types/node":"7.0.18","@types/simple-mock":"0.0.27","chai":"^3.5.0","chai-as-promised":"^6.0.0","graphql":"^0.10.1","istanbul":"1.0.0-alpha.2","mocha":"^3.0.0","mqtt-packet":"^6.0.0","remap-istanbul":"^0.9.5","simple-mock":"^0.7.0","tslint":"^5.2.0","typescript":"^2.3.4"},"typings":"dist/index.d.ts","typescript":{"definition":"dist/index.d.ts"},"gitHead":"b4b359eae434d7368c1e5ffbe66f3b7eda58c776","_id":"@blueeast/graphql-mqtt-subscriptions@2.1.5","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"bjavaid","email":"javaidbabar@gmail.com"},"dist":{"integrity":"sha512-ISITxREZ6EYEqFgqjkI3ybfnO2qDoWPwIySnWz9ZYuWjJ1chYiD5F7sF1dMV6EE/M3Kol9gtLnJqpmcEadD4TQ==","shasum":"c4714019b62f4b4a7e6766474d82a0dff7742e28","tarball":"https://registry.npmjs.org/@blueeast/graphql-mqtt-subscriptions/-/graphql-mqtt-subscriptions-2.1.5.tgz","fileCount":15,"unpackedSize":34244,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbTGcuCRA9TVsSAnZWagAAPvoP/19oGwBJA9AWp1fgls4b\nUZwaVNTYHOdOTdBqVEuyL7ll6+RuhKtcR+TxqzyBpPemnG+S4U/wfFANyVpZ\nMDgQh9VdTjCtRNXBwrNjtRMInEzLQdHoMOGKi9+5gcq8VKIQiZYCq0pLn3Ru\nLaSvOP0KItFp23pNzjrSCNkbgd128JG47Ke5C6MMNI9VSD3Qm760Mzw0LKCh\neuAV3x08OzoiW+uRqtqCIytPLiGfeSZISRjC7FmBRuxsP5c2DY7A7MwCIesR\nWSdhzEonMyBrpIABQVMWtzW7qQ0K6KZss9cxmN15Ev4PXfHM/WDqCfL0yC37\n7gUmU62UqNQoizNVoMcuHe1+B+Q/JpPI6ff/hD+7e8aQrGcX7bFi4cmG5s35\nLhka5IN+PEFh38bwYpL5HjGjgL1EYqdNgKmKPRxJZ+/MsLPc+TB/qF2Zf4Uq\nS8rlf/l1XT88zb2pbGdTVxcpXp5CfQKQ7md9sxDBlmzgiTvscwSGAdbyHq83\ng74n4fKHXzV7yfY71VBpKaxVlNZFkMz+jrXNFkylMTSIAHvTTyhkzp1jGyGt\nx7NI4QaHPYX19XkIpjd58wFM7nmQ50tfZ0CtDn7tXX87L8fMLktgY+XdMENU\nVXflWZ8HRcdL0QWjqfiZis6zXJiD3hnQY95IOzhUtBOpM2kpYLn0TIdJXhSO\nTNkX\r\n=uUGV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFGC/gTOpxhQvXWtJim01k1ZBR/YT43SdcPWG1i2d/tqAiA+/RXhX+eFmUse2GxVqTrBOQ60autDocNET/TpJx0MaQ=="}]},"maintainers":[{"name":"artalat","email":"rehman.talat@gmail.com"},{"name":"bjavaid","email":"javaidbabar@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-mqtt-subscriptions_2.1.5_1531733806153_0.39313681835398606"},"_hasShrinkwrap":false},"2.1.6":{"name":"@blueeast/graphql-mqtt-subscriptions","version":"2.1.6","description":"A graphql-subscriptions PubSub Engine using mqtt protocol","main":"dist/index.js","repository":{"type":"git","url":"git+https://github.com/BlueEastCode/graphql-mqtt-subscriptions.git"},"keywords":["graphql","mqtt","apollo","subscriptions","blueeast"],"files":["dist"],"author":{"name":"David Yahalomi, Abdul Ghaffar","email":"gmithoog@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/BlueEastCode/graphql-mqtt-subscriptions/issues"},"homepage":"https://github.com/BlueEastCode/graphql-mqtt-subscriptions","scripts":{"compile":"tsc --noUnusedParameters --noUnusedLocals","pretest":"true","test":"true","posttest":"npm run lint","lint":"tslint ./src/**/*.ts","watch":"tsc -w","testonly":"mocha --reporter spec --full-trace ./dist/test/tests.js ","integration":"npm run compile && mocha --reporter spec --full-trace ./dist/test/integration-tests.js ","benchmark":"npm run compile && mocha --reporter spec --full-trace ./dist/test/benchmark.js ","coverage":"node ./node_modules/istanbul/lib/cli.js cover _mocha -- --full-trace ./dist/test/tests.js","postcoverage":"remap-istanbul --input coverage/coverage.raw.json --type lcovonly --output coverage/lcov.info","prepublish":"npm run test"},"dependencies":{"graphql-subscriptions":"0.4.2","iterall":"^1.1.1","mqtt":"2.18.0"},"devDependencies":{"@types/chai":"^3.4.34","@types/chai-as-promised":"0.0.30","@types/graphql":"^0.9.0","@types/mocha":"^2.2.33","@types/node":"7.0.18","@types/simple-mock":"0.0.27","chai":"^3.5.0","chai-as-promised":"^6.0.0","graphql":"^0.10.1","istanbul":"1.0.0-alpha.2","mocha":"^3.0.0","mqtt-packet":"^6.0.0","remap-istanbul":"^0.9.5","simple-mock":"^0.7.0","tslint":"^5.2.0","typescript":"^2.3.4"},"typings":"dist/index.d.ts","typescript":{"definition":"dist/index.d.ts"},"gitHead":"fb2ad1607e1387dfdf18886308e7fcfe6ce8e1d1","_id":"@blueeast/graphql-mqtt-subscriptions@2.1.6","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"bjavaid","email":"javaidbabar@gmail.com"},"dist":{"integrity":"sha512-pV/WdBvxrByNQJmcBrHPusDsCmS7qXIVbLV6C1O7s35i2461eYp81smO6hakORSNKbmFbajD6/yka7BKulMSbQ==","shasum":"3c3e8be2c6eb2942b2c7001d5e1314e5921c6c44","tarball":"https://registry.npmjs.org/@blueeast/graphql-mqtt-subscriptions/-/graphql-mqtt-subscriptions-2.1.6.tgz","fileCount":15,"unpackedSize":34243,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbUdnlCRA9TVsSAnZWagAA/fwP/2Td+apPaOyderWou7bt\n4KDVdKSJ7hCEnDcBvKIe1mwcC6CeNWi4Y0Nfrssw8F0ax5hM1PIKEC+ey0aQ\nTqej7Nl8nau6mcoiJ1uUJTyVvAhmWvQDI3E2Cv/h9XCMwDICzDtdZNklnB5/\nbnwLQFk6prhTGumSVUaDQqyVfFjjppygOHljykUS8XR38n+Py6m2h5KJUj/j\nKNBGvhV1298V/mqfff5uj5guD74QhOLcxAaGG0nxfH8Z8yO4hPfTrI1itkK9\nICwYPKihl/btlf/K3DjNd27bIAWNhBJl/udOeRe0GBXkVHKj8R+DyWF+GbND\n6JfCMZqrWNL2fLfl91d02anXRCR4T3Sol0hPqG8H4imkqurhr/EsOE91sr2n\nOshL9tXyJs1yzYndlhYjNX2lMHflkWofWzXPBCbHVyFmZae4cIuwZMlLztHN\nZuvwrULwjCtrD2hiWBaMpaE7Fhm9hPjVDXatlcg/TEZgTzTowSul/G+T6ZWf\nDR0bLfhuesEYbZ23AanpzM/OxOaCqiGuH7o5qtLloL+BE9oloeLsh+VppNsv\nS44GakeOfHe9mSdY9d5R7J6EsryEDVWtQuH/rvCn7168Oqj/l25CFiqtpPgW\n6o6hv/tc9+r4B7bkKCL3I1/dMTvYKDYzVP0hvxb5oyVyzjSg/uV9nXpbSoar\nwnlv\r\n=Pbm/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA9cnVAlvnGecGyvpYIQPw+VONL7rkJIhztJ3cS1lvHMAiEArEYEO44gLXzREUUQnL9dygtD2YTSm+1AGwu0QkriDAY="}]},"maintainers":[{"name":"artalat","email":"rehman.talat@gmail.com"},{"name":"bjavaid","email":"javaidbabar@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-mqtt-subscriptions_2.1.6_1532090853382_0.22022792103387268"},"_hasShrinkwrap":false},"2.1.7":{"name":"@blueeast/graphql-mqtt-subscriptions","version":"2.1.7","description":"A graphql-subscriptions PubSub Engine using mqtt protocol","main":"dist/index.js","repository":{"type":"git","url":"git+https://github.com/BlueEastCode/graphql-mqtt-subscriptions.git"},"keywords":["graphql","mqtt","apollo","subscriptions","blueeast"],"files":["dist"],"author":{"name":"David Yahalomi, Abdul Ghaffar","email":"gmithoog@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/BlueEastCode/graphql-mqtt-subscriptions/issues"},"homepage":"https://github.com/BlueEastCode/graphql-mqtt-subscriptions","scripts":{"compile":"tsc --noUnusedParameters --noUnusedLocals","pretest":"true","test":"true","posttest":"npm run lint","lint":"tslint ./src/**/*.ts","watch":"tsc -w","testonly":"mocha --reporter spec --full-trace ./dist/test/tests.js ","integration":"npm run compile && mocha --reporter spec --full-trace ./dist/test/integration-tests.js ","benchmark":"npm run compile && mocha --reporter spec --full-trace ./dist/test/benchmark.js ","coverage":"node ./node_modules/istanbul/lib/cli.js cover _mocha -- --full-trace ./dist/test/tests.js","postcoverage":"remap-istanbul --input coverage/coverage.raw.json --type lcovonly --output coverage/lcov.info","prepublish":"npm run test"},"dependencies":{"graphql-subscriptions":"0.4.2","iterall":"^1.1.1","mqtt":"2.18.0"},"devDependencies":{"@types/chai":"^3.4.34","@types/chai-as-promised":"0.0.30","@types/graphql":"^0.9.0","@types/mocha":"^2.2.33","@types/node":"7.0.18","@types/simple-mock":"0.0.27","chai":"^3.5.0","chai-as-promised":"^6.0.0","graphql":"^0.10.1","istanbul":"1.0.0-alpha.2","mocha":"^3.0.0","mqtt-packet":"^6.0.0","remap-istanbul":"^0.9.5","simple-mock":"^0.7.0","tslint":"^5.2.0","typescript":"^2.3.4"},"typings":"dist/index.d.ts","typescript":{"definition":"dist/index.d.ts"},"gitHead":"673eaaa5a23ee522135468aa9b855d6bb85a2081","_id":"@blueeast/graphql-mqtt-subscriptions@2.1.7","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"bjavaid","email":"javaidbabar@gmail.com"},"dist":{"integrity":"sha512-YBQYEi1Dc3BTGtpILNsd0NosCx9EdxzPyekQGkTK6S+go1T88AbZUihuGak64ViSOqfH0Aakm24v72Ix6+45Vg==","shasum":"91932173cf8f12ae9e9f9efec63588f4563669ad","tarball":"https://registry.npmjs.org/@blueeast/graphql-mqtt-subscriptions/-/graphql-mqtt-subscriptions-2.1.7.tgz","fileCount":15,"unpackedSize":34310,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbUdopCRA9TVsSAnZWagAAj2IP/R9mNqMkC0gZ5ixfM9sG\nqMmpWMWKrhIcd9xaZMBQthu9Q2s2+t5eaILhQPximw2xyi3P/28eCqzG3J1u\n0vNYyNdMQxJrgaU6obQXMrPVFHktlIM+g20dgfBLio/BVbNS4n35c/ste70q\n077R9fCwUjpGGvv6GfWPUHFsAlKR/DZ1c1VS0Ces5mXKAfUi/3elZBJXUGmF\nbn9P5lv3ZPx81Q+jTkrb/8SmxUw/4rYVLW2u7aCoJjHpphs6hAdn0J4DIiNN\n8QKsgkXpq14TzL/Hjgn3WSO0BdRcfxwgTSHw1Jgtx0GAkpa5WMtTgkeg4wlW\nSEFqZyL7RFmzIT5m4HdrE2wPdGC4lj2Be5cMyCSxMnJiUr8EwKIp5/RRt1GN\nsw6SmvnL/HKfK1FDDsExNu+OYWHxrVmTlfdDNh9DGTF8YNR6czcNClpVw0KP\nBcBi+bjeuR+s4agrydgYUkfXFK7vSF2RzBMorJ2KBj4UgDW6/63iV6M2l69d\nfA3hjyTeAmBEbPMOKDSyJ4T00LLYF9zmwFwljTZjYKQGPxfDdfWn+odNpnSu\nIIAHUQ9s8TLg6Nx9G8nuar1PdyTdgoLlO1XkktFrcUYJ0PuVIRf+SYEcgi8F\nuA7/4+dvnF/tWCoiq/8DxHRVLfXH8GTd5NKQSnLKWVohzS8Rgui9jIZ1a6MV\nEt2S\r\n=vjks\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHF5PWcEyIHaI37Ov1WI2Q+NCgMPzqV6qL23O0yXIKkTAiEA6ZKsxCT2SwIbvzzHHKRqmgUoUY/HRMmCsimbaumEWBs="}]},"maintainers":[{"name":"artalat","email":"rehman.talat@gmail.com"},{"name":"bjavaid","email":"javaidbabar@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-mqtt-subscriptions_2.1.7_1532090920950_0.5819922895983529"},"_hasShrinkwrap":false}},"time":{"created":"2018-06-19T12:39:56.160Z","2.1.3":"2018-06-19T12:39:56.432Z","modified":"2022-04-04T19:47:22.165Z","2.1.5":"2018-07-16T09:36:46.260Z","2.1.6":"2018-07-20T12:47:33.777Z","2.1.7":"2018-07-20T12:48:41.043Z"},"maintainers":[{"email":"bluebase-release-bot@blueeast.com","name":"bluebase-release-bot"},{"email":"abubakar.mani1@gmail.com","name":"abubakarsaddique"},{"email":"rehman.talat@gmail.com","name":"artalat"}],"description":"A graphql-subscriptions PubSub Engine using mqtt protocol","homepage":"https://github.com/BlueEastCode/graphql-mqtt-subscriptions","keywords":["graphql","mqtt","apollo","subscriptions","blueeast"],"repository":{"type":"git","url":"git+https://github.com/BlueEastCode/graphql-mqtt-subscriptions.git"},"author":{"name":"David Yahalomi, Abdul Ghaffar","email":"gmithoog@gmail.com"},"bugs":{"url":"https://github.com/BlueEastCode/graphql-mqtt-subscriptions/issues"},"license":"MIT","readme":"# @BlueEast graphql-mqtt-subscriptions\n\nThis package implements the PubSubEngine Interface from the graphql-subscriptions package.\nIt allows you to connect your subscriptions manager to an MQTT enabled Pub Sub broker to support\nhorizontally scalable subscriptions setup.\nThis package is an adapted version of my [graphql-redis-subscriptions](https://github.com/davidyaha/graphql-redis-subscriptions) package.\n\n\n## Basic Usage\n\n```javascript\nimport { MQTTPubSub } from 'graphql-mqtt-subscriptions';\nconst pubsub = new MQTTPubSub(); // connecting to mqtt://localhost on default\nconst subscriptionManager = new SubscriptionManager({\n  schema,\n  pubsub,\n  setupFunctions: {},\n});\n```\n\n## Using Trigger Transform\n\nAs the [graphql-redis-subscriptions](https://github.com/davidyaha/graphql-redis-subscriptions) package, this package support\na trigger transform function. This trigger transform allows you to use the `channelOptions` object provided to the `SubscriptionManager`\ninstance, and return trigger string which is more detailed then the regular trigger.\n\nFirst I create a simple and generic trigger transform\n```javascript\nconst triggerTransform = (trigger, {path}) => [trigger, ...path].join('.');\n```\n> Note that I expect a `path` field to be passed to the `channelOptions` but you can do whatever you want.\n\nNext, I'll pass the `triggerTransform` to the `MQTTPubSub` constructor.\n```javascript\nconst pubsub = new MQTTPubSub({\n  triggerTransform,\n});\n```\nLastly, I provide a setupFunction for `commentsAdded` subscription field.\nIt specifies one trigger called `comments.added` and it is called with the `channelOptions` object that holds `repoName` path fragment.\n```javascript\nconst subscriptionManager = new SubscriptionManager({\n  schema,\n  setupFunctions: {\n    commentsAdded: (options, {repoName}) => ({\n      'comments/added': {\n        channelOptions: { path: [repoName] },\n      },\n    }),\n  },\n  pubsub,\n});\n```\n> Note that here is where I satisfy my `triggerTransform` dependency on the `path` field.\n\nWhen I call `subscribe` like this:\n```javascript\nconst query = `\n  subscription X($repoName: String!) {\n    commentsAdded(repoName: $repoName)\n  }\n`;\nconst variables = {repoName: 'graphql-redis-subscriptions'};\nsubscriptionManager.subscribe({ query, operationName: 'X', variables, callback });\n```\n\nThe subscription string that Redis will receive will be `comments.added.graphql-redis-subscriptions`.\nThis subscription string is much more specific and means the the filtering required for this type of subscription is not needed anymore.\nThis is one step towards lifting the load off of the graphql api server regarding subscriptions.\n\n## Passing your own client object\n\nThe basic usage is great for development and you will be able to connect to any mqtt enabled server running on your system seamlessly.\nBut for any production usage you should probably pass in your own configured client object;\n\n```javascript\nimport { connect } from 'mqtt';\nimport { MQTTPubSub } from 'graphql-mqtt-subscriptions';\n\nconst client = connect('mqtt://test.mosquitto.org', {\n  reconnectPeriod: 1000,\n});\n\nconst pubsub = new MQTTPubSub({\n  client,\n});\n```\n\nYou can learn more on the mqtt options object [here](https://github.com/mqttjs/MQTT.js#client).\n\n## Changing QoS for publications or subscriptions\n\nAs specified [here](https://github.com/mqttjs/MQTT.js#publish), the MQTT.js publish and subscribe functions takes an\noption object. This object could be defined per trigger with `publishOptions` and `subscribeOptions` resolvers.\n\n```javascript\nconst triggerToQoSMap = {\n  'comments.added': 1,\n  'comments.updated': 2,\n};\n\nconst pubsub = new MQTTPubSub({\n  publishOptions: trigger => Promise.resolve({ qos: triggerToQoSMap[trigger] }),\n\n  subscribeOptions: (trigger, channelOptions) => Promise.resolve({\n    qos: Math.max(triggerToQoSMap[trigger], channelOptions.maxQoS),\n  }),\n});\n```\n\n## Get notified on the actual QoS assigned for subscription\n\nMQTT allows the broker to assign different QoS level than the one requested by the client.\nIn order to know what QoS was defined for your subscription you can pass in a callback called `onMQTTSubscribe`\n\n```javascript\nconst onMQTTSubscribe = (subId, granted) => {\n  console.log(`Subscription with id ${subId} was given QoS of ${granted.qos}`);\n}\n\nconst pubsub = new MQTTPubSub({onMQTTSubscribe});\n```\n\n## Change encoding used to encode and decode messages\n\nSupported encodings available [here](https://nodejs.org/api/buffer.html#buffer_buffers_and_character_encodings)\n\n```javascript\nconst pubsub = new MQTTPubSub({\n  parseMessageWithEncoding: 'utf16le',\n});\n```\n","readmeFilename":"README.md"}