Skip to content

Commit

Permalink
changeset for fastify websocket context extra rename
Browse files Browse the repository at this point in the history
  • Loading branch information
enisdenjo committed Jan 15, 2025
1 parent 29dd26a commit b668b30
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions .changeset/big-camels-tap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
'graphql-ws': major
---

@fastify/websocket WebSocket in the context extra has been renamed from `connection` to `socket`

### Migrating from v5 to v6

```diff
import { makeHandler } from 'graphql-ws/use/@fastify/websocket';

makeHandler({
schema(ctx) {
- const websocket = ctx.connection;
+ const websocket = ctx.socket;
},
context(ctx) {
- const websocket = ctx.connection;
+ const websocket = ctx.socket;
},
onConnect(ctx) {
- const websocket = ctx.connection;
+ const websocket = ctx.socket;
},
onDisconnect(ctx) {
- const websocket = ctx.connection;
+ const websocket = ctx.socket;
},
onClose(ctx) {
- const websocket = ctx.connection;
+ const websocket = ctx.socket;
},
onSubscribe(ctx) {
- const websocket = ctx.connection;
+ const websocket = ctx.socket;
},
onOperation(ctx) {
- const websocket = ctx.connection;
+ const websocket = ctx.socket;
},
onError(ctx) {
- const websocket = ctx.connection;
+ const websocket = ctx.socket;
},
onNext(ctx) {
- const websocket = ctx.connection;
+ const websocket = ctx.socket;
},
onComplete(ctx) {
- const websocket = ctx.connection;
+ const websocket = ctx.socket;
},
});
```

0 comments on commit b668b30

Please sign in to comment.