Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to master, this PR will be updated.
Releases
@ilijanl/graphql-ws-graphqless@5.14.0
Minor Changes
Features
1.0.0 (2023-03-16)
Bug Fixes
browser
export map (ea306db)package.json
to exports map (#119) (1f09863), closes #118uWebSockets
exports path (36247cb), closes #155graphql@v16
(ad5aea2)exports
(#375) (9f394d7)complete
should not be called after subscriptionerror
(1fba419)ConnectionInit
payload is absent ifconnectionParams
returns nothing (98f8265)isFatalConnectionProblem
defaults to undefined for usingshouldRetry
(9d5c573)operationName
andvariables
(2d60dda)CloseEvent.reason
after bundling so just pass the whole event to the sink error and let the user handle it (9ccb46b)wasClean
is not necessary (2c65f0e), closes #81lazyCloseTimeout
(c332837), closes #388error
event listener for handling connection errors (#136) (127b69f), closes #135query
is required in the subscribe payload (e892530)message
event (#104) (68d0e20), closes #102Complete
message followed (27754b2), closes #245closed
event when disposing (5800de8), closes #108Complete
message if socket is not open (cd12024)connectionParams
took too long and the server kicked the client off (1e94e45), closes #331exports
field and use.mjs
suffixed ESM imports (#110) (4196238)types
file holding important types (f3e4edf)exports
is just"."
(8f70b02)data
field to be of any type (533248e), closes #72payload
field to be of any type forNextMessage
(7cebbfe), closes #72handleProtocols
accepts arrays too and gracefully rejects other types (98dec1a), closes #318onDisconnect
is called exclusively if the connection is acknowledged (33ed5f2)return
instead ofbreak
at switch case ends (e9447e4), closes #140subscription
operations are distinct on the message ID (#24) (dfffb05)return
(d99982b), closes #149onSubscribe
returns invalid array (#53) (0464a54)rootValue
andcontextValue
, if not overridden (#49) (7aa3bcd)Sec-WebSocket-Protocol
header if none supported (9bae064)onSubscribe
result exclusively (51fdb7c)this
scope (f76ac73)ConnectionInit
message closes the socket immediately (757c6e9)subscribe
oronOperation
didnt resolve yet (4700154)onConnect
(f91fadb)subscribe
from the config (6fbd47c)ExecutionResult
(045b402)graphql
versions (de69b4e)globalThis
(79c2ed2)4406
close code for unsupported subprotocol (1002
is an internal WebSocket close code) (df85281)4500
close code for internal server errors (1011
is an internal WebSocket close code) (3c0316d)ID
type for message id field (87ebd35)Error
(#442) (9884889), closes #441Features
cjs
,esm
andumd
builds with minification and compression for the browser (#58) (ebb8dfe)extensions
field to the subscribe message payload (d86a8e4)CloseCode
enum (d10a75c)connectionParams
can returnundefined
(a543187)connectionParams
may return a promise (#71) (33f210c)disablePong
option for when implementing a custom pinger (6510360), closes #117isFatalConnectionProblem
option for deciding if the connect error should be immediately reported or the connection retried (#126) (8115871), closes #122onNonLazyError
allows you to catch errors reported in non-lazy mode (cd1e7df)url
option accepts a function or a Promise (#143) (76f522f), closes #145 #146connectionAckWaitTimeout
option (#228) (35ce054)opened
event for when a WebSocket opens (9053224)isFatalConnectionProblem
option in favour ofshouldRetry
(d8dcf21)connecting
,connected
andclosed
(627775b)generateID
to provide subscription IDs (#22) (9a3f54a), closes #21generateID
(d0bc6e1), closes #398keepAlive
option tolazyCloseTimeout
(3c1f13c)payload
for ping/pong message types (2fe0345), closes #117@enisdenjo/graphql-transport-ws
👉graphql-transport-ws
. (494f676)ConnectionAck
message (#60) (1327e77)context
may return a promise (cd5c2f8), closes #74execute
andsubscribe
are optional (#148) (af748b0)onClose
callback for closures at any point in time (dd0d4fa)onDisconnect
callback (#94) (2a61268)ws@v8
(9119153)context
in creation options (5b3d253), closes #13schema
support by accepting a function or a Promise (#147) (6a0bf94), closes #127context
option can be a function too (#46) (149b582)onPing
andonPong
message type listeners (f36066f)execute
(#28) (dbbd88b)@fastify/websocket
(#382) (dd755b0), closes #381fastify-websocket
(#200) (b62fc95)validate
option for custom GraphQL validation (b68d56c)query
must be a string (#45) (60d9cd5)reviver
andreplacer
(#172) (0a9894e)connectionParams
) (#311) (e67cf80)persistedRequest
to context extra and deprecate uWS's stack allocatedrequest
(#196) (736e6ed)request
context extra (02ea5ee)Performance Improvements
id
(#150) (32c2268)Reverts
BREAKING CHANGES
Beware, the client will NOT ping the server by default. Please make sure to upgrade your stack in order to support the new ping/pong message types.
A simple recipe showcasing a client that times out if no pong is received and measures latency, looks like this:
request
context extra field has been dropped because it is stack allocated and cannot be used ouside the internalupgrade
callback.keepAlive
option has been renamed tolazyCloseTimeout
in order to eliminate ambiguity with the client to server pings keep-alive option.server.opened
(closed
) now requires the close event code and reason for reporting to theonDisconnect
callback.Context.subscriptions
record value can be either anAsyncIterator
or aPromise
.retryTimeout
option has been replaced with the newretryWait
.retryWait
allows you to control the retry timeout strategy by resolving the returned promise when ready. The default implements the randomised exponential backoff like so:Summary of breaking changes:
keepAlive
. The user should provide its own keep-alive implementation. (I highly recommend WebSocket Ping and Pongs)request
in the server context.makeServer
(no morecreateServer
)Benefits
extra
field in theContext
for storing custom values useful for callbacksMigrating from v1
Only the server has to be migrated. Since this release allows you to use your favourite WebSocket library (or your own implementation), using ws is just one way of using
graphql-ws
. This is how to use the implementation shipped with the lib:subscriptions-transport-ws
. It follows a redesigned transport protocol aiming to improve security, stability and reduce ambiguity.5.12.0 (2023-03-06)
Features