graphql-ws
Advanced tools
Comparing version 4.8.0 to 4.9.0
@@ -0,1 +1,8 @@ | ||
# [4.9.0](https://github.com/enisdenjo/graphql-ws/compare/v4.8.0...v4.9.0) (2021-06-06) | ||
### Features | ||
* **server:** Use `fastify-websocket` ([#200](https://github.com/enisdenjo/graphql-ws/issues/200)) ([b62fc95](https://github.com/enisdenjo/graphql-ws/commit/b62fc958bb0b67224d3c1b684d441bd8349c4b8a)) | ||
# [4.8.0](https://github.com/enisdenjo/graphql-ws/compare/v4.7.0...v4.8.0) (2021-06-03) | ||
@@ -2,0 +9,0 @@ |
{ | ||
"name": "graphql-ws", | ||
"version": "4.8.0", | ||
"version": "4.9.0", | ||
"description": "Coherent, zero-dependency, lazy, simple, GraphQL over WebSocket Protocol compliant server and client", | ||
@@ -44,2 +44,6 @@ "keywords": [ | ||
}, | ||
"./lib/use/fastify-websocket": { | ||
"require": "./lib/use/fastify-websocket.js", | ||
"import": "./lib/use/fastify-websocket.mjs" | ||
}, | ||
"./package.json": "./package.json" | ||
@@ -94,2 +98,4 @@ }, | ||
"eslint-plugin-prettier": "^3.4.0", | ||
"fastify": "^3.17.0", | ||
"fastify-websocket": "^3.2.0", | ||
"glob": "^7.1.7", | ||
@@ -96,0 +102,0 @@ "graphql": "^15.5.0", |
@@ -95,2 +95,30 @@ <div align="center"> | ||
##### With [fastify-websocket](https://github.com/fastify/fastify-websocket) | ||
```ts | ||
import Fastify from 'fastify'; // yarn add fastify | ||
import fastifyWebsocket from 'fastify-websocket'; // yarn add fastify-websocket | ||
import { makeHandler } from 'graphql-ws/lib/use/fastify-websocket'; | ||
const fastify = Fastify(); | ||
fastify.register(fastifyWebsocket); | ||
fastify.get( | ||
'/graphql', | ||
{ websocket: true }, | ||
makeHandler( | ||
// from the previous step | ||
{ schema, roots }, | ||
), | ||
); | ||
fastify.listen(4000, (err) => { | ||
if (err) { | ||
fastify.log.error(err); | ||
return process.exit(1); | ||
} | ||
console.log('Listening to port 4000'); | ||
}); | ||
``` | ||
#### Use the client | ||
@@ -97,0 +125,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
259957
32
3567
1508
0
34
6