Skip to content

Commit b668b30

Browse files
committed
changeset for fastify websocket context extra rename
1 parent 29dd26a commit b668b30

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

.changeset/big-camels-tap.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
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+
```

0 commit comments

Comments
 (0)