{"_id":"@aaronpowell/graphql-signalr-subscriptions","_rev":"3-07c23fbfc19c1ec06a13d7f97efad18b","name":"@aaronpowell/graphql-signalr-subscriptions","dist-tags":{"latest":"0.3.0"},"versions":{"0.1.1":{"name":"@aaronpowell/graphql-signalr-subscriptions","private":false,"version":"0.1.1","main":"./dist/esm/SignalRPubSub.js","types":"./dist/esm/*.d.ts","exports":{"import":"./dist/esm/SignalRPubSub.js","require":"./dist/cjs/SignalRPubSub.js"},"type":"module","scripts":{"build":"tsc","build:cjs":"tsc --module commonjs --outDir dist/cjs","build:all":"npm run build && npm run build:cjs","watch":"tsc -w","lint":"eslint src/**/*.ts","lint:fix":"npm run lint -- --fix","clean":"rm -rf dist"},"keywords":["azure","graphql","websockets"],"author":{"name":"Aaron Powell","email":"me+github@aaron-powell.com","url":"https://www.aaron-powell.com"},"license":"MIT","description":"A GraphQL subscriptions library using Azure SignalR Service","devDependencies":{"@types/jsonwebtoken":"^8.5.0","@types/node-fetch":"^2.5.8","@typescript-eslint/eslint-plugin":"^4.15.1","@typescript-eslint/parser":"^4.15.1","eslint":"^7.20.0","eslint-config-prettier":"^7.2.0","eslint-plugin-prettier":"^3.3.1","husky":"^5.0.9","prettier":"^2.2.1","typescript":"^4.1.5"},"dependencies":{"@aspnet/signalr":"^1.1.4","graphql-subscriptions":"^1.2.0","jsonwebtoken":"^8.5.1","node-fetch":"^2.6.1"},"husky":{"hooks":{"pre-commit":"npm run lint"}},"repository":{"type":"git","url":"git+https://github.com/aaronpowell/graphql-azure-subscriptions.git"},"bugs":{"url":"https://github.com/aaronpowell/graphql-azure-subscriptions/issues"},"homepage":"https://github.com/aaronpowell/graphql-azure-subscriptions","_resolved":"","_integrity":"","_from":"file:aaronpowell-graphql-signalr-subscriptions-0.1.1.tgz","_id":"@aaronpowell/graphql-signalr-subscriptions@0.1.1","_nodeVersion":"14.15.4","_npmVersion":"6.14.10","dist":{"integrity":"sha512-b3SgMFthyklSwT/GhLzyCJ4H4mRlj6OM7j7fvgcQTZhvx+moz8XzDFMzoAEdc1wNnuD1a7bENozcw9GFZYikhg==","shasum":"5b19752c98e4e6c38c7aad4ae3a1276874b45739","tarball":"https://registry.npmjs.org/@aaronpowell/graphql-signalr-subscriptions/-/graphql-signalr-subscriptions-0.1.1.tgz","fileCount":21,"unpackedSize":29573,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgLLO7CRA9TVsSAnZWagAAHz0QAIS1Se2qZstwfJeJ/+If\noRzaWiDERFRcwcJQyHZ+LMA31+kXcVUUDZ1NgfjjHy6SBDf/cH80jKszFOqn\nfrZ9Cy8ZkZ0Uw1AEJZ/Te28JOAqOKOubkBhGP02XcNVC6YqM/v3hH1lo0IS4\nbhuLpGk+qRGd1Uc8zDr9SAvA+oEh2TDdxqHfdBP2rdfmqm19WpCY+Bp2nrOb\nm2iWCHzSpnUhy25zfSbDKozQM+4A3l26ReyYNRyBlPPjFRoD0dv0X8bVxj3U\nrdS/bJFt48mTJ+Wf6WOMkun9G7npuimq0x+6ToXguLCQpYwsvKNkt6MYZXY+\n0ltqyAwbrm/FzXFvmb+sfb2QYTI2pwWT9mfHvcklfw/MMvz8UA6qZirLqxoD\nVtCKlR9FMx+MwoU2u+YyWAtSyVVwFj4Ai+hNAC3gB7f/XOXrAb2gDwaTVowD\nI5GaBlXX+B4pH0AmIq3hR54urHjHeahp7sMNpjdHW7DH8RAnWjAR/dzv4NKF\nn0b+zL1/tDjLoTwy+pju+VKXyq6pBvrSo6uT+9cV9GzYnBzgv/b8xV92oDTY\n62XxiW74tNL2fzaqRekOIaw3kt/gPoLx1/lMRP6ob9AwuH0NbMCta2yZ3l62\nvtdJw+e5F+f8aYTpf/qIXS9fI9nsR95i4RSdtZ+kvL3j3fyfc3SuwUde2G9z\nHRor\r\n=LE0w\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE2UGczfhbjikrcEVmyGTaemUG4BIyPxnDMRkeMl+W33AiEA6tyg5j8Jdzyxs4ul3TV9sa3HwdTgMdaOdeMUkm2wIVY="}]},"_npmUser":{"name":"aaronpowell","email":"me@aaron-powell.com"},"directories":{},"maintainers":[{"name":"aaronpowell","email":"me@aaron-powell.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-signalr-subscriptions_0.1.1_1613542330983_0.45511198827960353"},"_hasShrinkwrap":false},"0.2.0":{"name":"@aaronpowell/graphql-signalr-subscriptions","private":false,"version":"0.2.0","main":"./dist/esm/SignalRPubSub.js","types":"./dist/esm/SignalRPubSub.d.ts","exports":{"import":"./dist/esm/SignalRPubSub.js","require":"./dist/cjs/SignalRPubSub.js"},"type":"module","scripts":{"build:esm":"tsc","build:cjs":"tsc --module commonjs --outDir dist/cjs","build":"concurrently 'npm:build:esm' 'npm:build:cjs'","prebuild":"npm run clean","watch":"tsc -w","lint":"eslint src/**/*.ts","lint:fix":"npm run lint -- --fix","clean":"rm -rf dist"},"keywords":["azure","graphql","websockets"],"author":{"name":"Aaron Powell","email":"me+github@aaron-powell.com","url":"https://www.aaron-powell.com"},"license":"MIT","description":"A GraphQL subscriptions library using Azure SignalR Service","devDependencies":{"@types/jsonwebtoken":"^8.5.0","@types/node-fetch":"^2.5.8","@typescript-eslint/eslint-plugin":"^4.15.1","@typescript-eslint/parser":"^4.15.1","concurrently":"^6.0.0","eslint":"^7.20.0","eslint-config-prettier":"^7.2.0","eslint-plugin-prettier":"^3.3.1","prettier":"^2.2.1","typescript":"^4.1.5"},"dependencies":{"@aspnet/signalr":"^1.1.4","graphql-subscriptions":"1.2.0","jsonwebtoken":"^8.5.1","node-fetch":"^2.6.1"},"repository":{"type":"git","url":"git+https://github.com/aaronpowell/graphql-azure-subscriptions.git"},"bugs":{"url":"https://github.com/aaronpowell/graphql-azure-subscriptions/issues"},"homepage":"https://github.com/aaronpowell/graphql-azure-subscriptions","_resolved":"","_integrity":"","_from":"file:aaronpowell-graphql-signalr-subscriptions-0.2.0.tgz","_id":"@aaronpowell/graphql-signalr-subscriptions@0.2.0","_nodeVersion":"14.15.5","_npmVersion":"6.14.11","dist":{"integrity":"sha512-e+hbxAm6Ob5lG0Jewa2L2RATsxyqjKH+D2swd6WQiAKV5wSVR9HQdcleEFBtffKnh3uuH/4FWDi+oTR4QrWqDQ==","shasum":"a34c1584905279337485362eb249d58b3584a4e1","tarball":"https://registry.npmjs.org/@aaronpowell/graphql-signalr-subscriptions/-/graphql-signalr-subscriptions-0.2.0.tgz","fileCount":22,"unpackedSize":31160,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgOE/6CRA9TVsSAnZWagAAp4kP/iyHsfLHX5SgC91krkcB\n6m5kS5gVK5tqWrr9H+KsSOkIp0oVyIkBGxX8+zGubhZBo8J/bktTsCzer7lN\nwjK2tUVvlpD3HdfyQRN6ug7aajsaoV+bQSGZaXkWeaBWdjqlUtnHJ9GLl0nO\nJ6YOWJLkPXMb6LNiaDS5JyDrT3Lrn62M8KHXvLT79kcr8pGe2XXXbjcBgQ4/\njjYWhyeWfRXB8pZ4UPY90pYj18U+f3oOW1iNDIVKoOTaDlNdsthjFerCoH0V\nfQILj8eCgCf1zLCWlxbHUK4mdJucxet6fWAVEkZAIEx3qf4kPlUa44tb+86X\nvXZnqdd7hFxgoPXbXs+KihXFf3YPJlxVmt459tcfT5qBQI+xCrQVVgvDyC2c\nA+ojqmnIVY39odvkCaWp+1zaO2+5G2Q/0bksBHvHWFGXnF55I/qrG8o8pHb8\n56mLF0l4kAcHWHAGFXM/MQe1R8WJWD/Lu210kU5pNPTwyOv45IsNsLDqCv90\njpd7LyXQGnlc0Q8rXEImC679jmEl4GxxhYpFIU1InoCwmxfFHNFGnD7EXBZ8\nsMijFhN+PstN2Rbxay3vmovbyYjnldYe0lDXU1HdDfpYsjjR/IxcfPtIWXCS\nu4fVGcC36I5OkRkAkxnWVeYRpkYJAXECxuX9WDEEsO+dylWubeyzWA5Hxuq6\nS8Is\r\n=oece\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCnAFyFqL5noA1GZDUg+RAqNavsO7sN/cQJebraYOsetAIhAMyHYybDCQPNHLJDYFhooWgKV5hwEvlIwkGTXx+NUDDy"}]},"_npmUser":{"name":"aaronpowell","email":"me@aaron-powell.com"},"directories":{},"maintainers":[{"name":"aaronpowell","email":"me@aaron-powell.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-signalr-subscriptions_0.2.0_1614303225948_0.32402130441301824"},"_hasShrinkwrap":false},"0.3.0":{"name":"@aaronpowell/graphql-signalr-subscriptions","private":false,"version":"0.3.0","main":"./dist/esm/SignalRPubSub.js","types":"./dist/esm/SignalRPubSub.d.ts","exports":{"import":"./dist/esm/SignalRPubSub.js","require":"./dist/cjs/SignalRPubSub.js"},"type":"module","scripts":{"build:esm":"tsc","build:cjs":"tsc --module commonjs --outDir dist/cjs","build":"concurrently 'npm:build:esm' 'npm:build:cjs'","prebuild":"npm run clean","watch":"tsc -w","lint":"eslint src/**/*.ts","lint:fix":"npm run lint -- --fix","clean":"rm -rf dist"},"keywords":["azure","graphql","websockets"],"author":{"name":"Aaron Powell","email":"me+github@aaron-powell.com","url":"https://www.aaron-powell.com"},"license":"MIT","description":"A GraphQL subscriptions library using Azure SignalR Service","devDependencies":{"@types/jsonwebtoken":"^8.5.0","@types/node-fetch":"^2.5.8","@typescript-eslint/eslint-plugin":"^4.15.1","@typescript-eslint/parser":"^4.15.1","concurrently":"^6.0.0","eslint":"^7.20.0","eslint-config-prettier":"^7.2.0","eslint-plugin-prettier":"^3.3.1","prettier":"^2.2.1","typescript":"^4.1.5"},"dependencies":{"@microsoft/signalr":"^5.0.4","graphql-subscriptions":"1.2.0","jsonwebtoken":"^8.5.1","node-fetch":"^2.6.1"},"repository":{"type":"git","url":"git+https://github.com/aaronpowell/graphql-azure-subscriptions.git"},"bugs":{"url":"https://github.com/aaronpowell/graphql-azure-subscriptions/issues"},"homepage":"https://github.com/aaronpowell/graphql-azure-subscriptions","_resolved":"","_integrity":"","_from":"file:aaronpowell-graphql-signalr-subscriptions-0.3.0.tgz","_id":"@aaronpowell/graphql-signalr-subscriptions@0.3.0","_nodeVersion":"14.16.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-1P0ngqtWMqlCL3eE7aDS89pS8MtRhpMkbE4d3yw7E/1Lg1C5wWiEN9cESKTWUReE+sX7NHE2S3qZL8ApT3TKAg==","shasum":"0772127612fc72d1b67dc584c69b3d4018ee6587","tarball":"https://registry.npmjs.org/@aaronpowell/graphql-signalr-subscriptions/-/graphql-signalr-subscriptions-0.3.0.tgz","fileCount":22,"unpackedSize":31804,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgT/pFCRA9TVsSAnZWagAAlxsP/j7r9qIPJaky1jw2z867\npHYe3Pffg+W7nZjno7mJl/keRLQRGa9EdSrtUFM0e3zCiCznnaLxPv3MemcK\n6LLrSUKYhBD+EGY7ExHLmDF9YkHPyvyzwSVs2XOZdCxegUTTIY9nr1naT0Xm\ntL2RGKzw82vqlKv/ATAby2pnr5aVlbFXVJ0z74gVZNmXTZLHqVMEOHSW8euK\nRzaaPl2BfsWiU7YvJrDmRuT1swKc73T+RYwGdk6hIEhhRc8V7UkrGOAzjJzA\nUqN3MYbRpTornkl6+43PnUstmhk041itZZlGjCgmtniPvqxw+28vBYx7eiNS\nDjBS2YfE2FRYKNBYs0KcwWcOMIT+pyoJQKhn6h48cVmML7DCvsCaHvE6zcNE\ntOnf9SQ+Soj5avBMC1LhOY34aD2z3ONPaAH6XxrYBpotPTohAPXW1w1i2n6M\nyWsKqGA6UmRIdxhN0UzlVatlCyZeKLyff8uReB5tkO1wj+3+9aMXDHF1Pqcn\nOEUwzdPYeSw0BT+xnDe/EoiDqwk361IppU8gO4rTp7LxrmsO2NJrepOMDY07\n6lWTHvVsBfTSwolGkthhOyUUKroxrhYfxfKNqdbBR5WjJqYWWucCunsNi1ap\n/8Yx7bQ0II6vKryD+QQUNtKq/QFECylXJErE052fG/ReiwqOd9puHsFnK9lg\n9WJC\r\n=4SIb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD73oEw8tgo0od7ImbHfzNBIx9DaMy6vP5+Wi9rVWFCewIhAPD8pbgSm2zl6AdSdKdxNk3mWLcHbka9JrXQ6zdUcIxz"}]},"_npmUser":{"name":"aaronpowell","email":"me@aaron-powell.com"},"directories":{},"maintainers":[{"name":"aaronpowell","email":"me@aaron-powell.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-signalr-subscriptions_0.3.0_1615854148646_0.2282736976285762"},"_hasShrinkwrap":false}},"time":{"created":"2021-02-17T06:12:10.937Z","0.1.1":"2021-02-17T06:12:11.165Z","modified":"2022-04-04T10:55:45.243Z","0.2.0":"2021-02-26T01:33:46.062Z","0.3.0":"2021-03-16T00:22:28.800Z"},"maintainers":[{"name":"aaronpowell","email":"me@aaron-powell.com"}],"description":"A GraphQL subscriptions library using Azure SignalR Service","homepage":"https://github.com/aaronpowell/graphql-azure-subscriptions","keywords":["azure","graphql","websockets"],"repository":{"type":"git","url":"git+https://github.com/aaronpowell/graphql-azure-subscriptions.git"},"author":{"name":"Aaron Powell","email":"me+github@aaron-powell.com","url":"https://www.aaron-powell.com"},"bugs":{"url":"https://github.com/aaronpowell/graphql-azure-subscriptions/issues"},"license":"MIT","readme":"# SignalR GraphQL Subscriptions ![npm - SignalR package](https://img.shields.io/npm/v/@aaronpowell/graphql-signalr-subscriptions?label=%40aaronpowell%2Fgraphql-signalr-subscriptions)\n\nThis package contains support for [Apollo GraphQL Subscriptions](https://www.apollographql.com/docs/apollo-server/data/subscriptions), using the [Azure SignalR Service](https://azure.microsoft.com/services/signalr-service?WT.mc_id=javascript-17899-aapowell).\n\n## Installation\n\nInstall via npm or GitHub Packages:\n\n```bash\n$> npm install --save @aaronpowell/graphql-signalr-subscriptions\n```\n\n## Usage\n\nYou'll need a SignalR Service account (if you don't have an Azure account [sign up for free](https://azure.microsoft.com/free/?WT.mc_id=javascript-17899-aapowell)). Copy the connection string and provide it when you create an instance of `SignalRPubSub`:\n\n```typescript\nimport { SignalRPubSub } from \"@aaronpowell/graphql-signalr-subscriptions\";\n\nconst signalrPubSub = new SignalRPubSub(\"<connection string>\");\n```\n\nWhen your server is ready, you can start the pubsub client:\n\n```typescript\nsignalrPubSub\n  .start()\n  .then(() => console.log(\"SignalR PubSub is up and running\"))\n  .catch((error) => console.error(error));\n```\n\nFrom within a resolver, you use it the same as any other pubsub implementation:\n\n```typescript\nexport const resolvers = {\n  Query: {\n    hello() {\n      signalrPubSub.publish(\"TESTING\", { getMessage: \"Hello I'm a message\" });\n      return \"Some message\";\n    },\n  },\n  Subscription: {\n    getMessage: {\n      subscribe: () => signalrPubSub.asyncIterator([\"TESTING\"]),\n    },\n  },\n};\n```\n","readmeFilename":"README.md"}