Our great sponsors
-
graphql-ws
Coherent, zero-dependency, lazy, simple, GraphQL over WebSocket Protocol compliant server and client.
-
SurveyJS
Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
Is there any difference in using something like socket.io for websocket connections vs graphqls subscriptions?
When using a GraphQL over Websocket protocol you can execute all operation kinds (query, mutation and subscription) over that transport as it is a bidirectional protocol.
However, if you are doing GraphQL subscriptions over Server Sent Events (HTTP) (which is currently not part of the GraphQL over HTTP specification), the data flow is only from server to client. So each operation must be a separate request, which should be no problem when using HTTP/2, as the browser connection limit is not hit so fast (There are also workarounds to this if you cannot ise HTTP/2).