File tree Expand file tree Collapse file tree 1 file changed +54
-0
lines changed Expand file tree Collapse file tree 1 file changed +54
-0
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' graphql-ws ' : major
3+ ---
4+
5+ @fastify/websocket WebSocket in the context extra has been renamed from ` connection ` to ` socket `
6+
7+ ### Migrating from v5 to v6
8+
9+ ``` diff
10+ import { makeHandler } from 'graphql-ws/use/@fastify/websocket';
11+
12+ makeHandler({
13+ schema(ctx) {
14+ - const websocket = ctx.connection;
15+ + const websocket = ctx.socket;
16+ },
17+ context(ctx) {
18+ - const websocket = ctx.connection;
19+ + const websocket = ctx.socket;
20+ },
21+ onConnect(ctx) {
22+ - const websocket = ctx.connection;
23+ + const websocket = ctx.socket;
24+ },
25+ onDisconnect(ctx) {
26+ - const websocket = ctx.connection;
27+ + const websocket = ctx.socket;
28+ },
29+ onClose(ctx) {
30+ - const websocket = ctx.connection;
31+ + const websocket = ctx.socket;
32+ },
33+ onSubscribe(ctx) {
34+ - const websocket = ctx.connection;
35+ + const websocket = ctx.socket;
36+ },
37+ onOperation(ctx) {
38+ - const websocket = ctx.connection;
39+ + const websocket = ctx.socket;
40+ },
41+ onError(ctx) {
42+ - const websocket = ctx.connection;
43+ + const websocket = ctx.socket;
44+ },
45+ onNext(ctx) {
46+ - const websocket = ctx.connection;
47+ + const websocket = ctx.socket;
48+ },
49+ onComplete(ctx) {
50+ - const websocket = ctx.connection;
51+ + const websocket = ctx.socket;
52+ },
53+ });
54+ ```
You can’t perform that action at this time.
0 commit comments