-
-
Notifications
You must be signed in to change notification settings - Fork 164
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
changeset for fastify websocket context extra rename
- Loading branch information
Showing
1 changed file
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
}, | ||
}); | ||
``` |