Support GraphQL over Websocket

:wave: ,

I am the author of graphql-ws and its, brand new, security first, lean, GraphQL over WebSocket Protocol.

The Protocol is aiming to become a part of the GraphQL standard with the help of the foundation’s brilliant GraphQL over HTTP Work Group.

I’d like to hear your opinion on the Protocol and if you would consider supporting it in your awesome Graph database?

If you are interested on reading a short article about the lib and its inception, you can check it out over at The Guild’s blog.

P.S. subscriptions-transport-ws's readme now officially recommends using graphql-ws instead.

links have now been restored.


I get this error Error during WebSocket handshake: Unexpected response code: 200 so I assume it does not work outside of the box?

The transport Protocol is completely different, so no - it does not work out of the box.

Dgraph uses Apollo’s subscriptions-transport-ws and their deprecated transport Protocol. The new Protocol is a rewrite and the two are not interchangeable.

@hardik Any chance of adding this to the Dgraph Roadmap of 2021?


I edited Denis’ post to add links back. It was rather annoying not being able to click on them. @pawan this is something we should look at.

Also I moved this into its own post because this is a feature request.

@jdgamble555 will bring this up in our roadmap discussion. Will keep you posted.


Sounds great. A more general approach than Apollo is certainly appreciated.

GraphQL over WebSockets - The Guild Blog (

Thought I mention this link. The also point out a couple of sec issues and shortcomings with the subscriptions-transport-ws protocoll (that you are probably aware of) and that make a compelling argument for me to stay away from it.

Yap, I referenced that blog in my original comment. I am fully aware of everything mentioned in the blog post as I am the one that wrote it (if you were talking to me). :smiley:

1 Like

Consider me ashamed, I am not sure what I was doing just then :sweat_smile: My apologies! Of course you do. Let me make the best of the situation and at least thank you for an excellent library and blog post. :slightly_smiling_face:

1 Like

Absolutely no worries! It happens, just wanted to update you. You’re very welcome, glad my contribution helps people. :smiley:


Here’s a nice comparison article about performance of GraphQL over HTTP vs Websocket (It includes REST as well :sweat_smile: ): OpenShift Console Meets GraphQL Over WebSocket

Nice post, but they have sadly choosen the unmaintained subscriptions-transport-ws protocol and client side lib. :grimacing:

Nevertheless, I’d say the blog’s results wouldnt differ much either way.

@hardik - any news on getting this this year? I think keeping it up to date and secure is always important :slight_smile:


Bumping this topic. Is there a current opinion from the DGraph dev team on the relative prioritization of this?

This has already been mentioned, but it stands out that the library in question is no longer supported. From the message on github repo:

The subscriptions-transport-ws library is not being actively maintained. It is recommended that you use the [graphql-ws]( library instead. For details read the [GraphQL over WebSockets]( announcement.

I am tagging along here. An updated WS protocol would be a killer feature for me. I am not comfy with using deprecated apis for this…

1 Like