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.

MOD EDIT NOTE:
links have now been restored.

2 Likes

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?

2 Likes

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.

2 Likes

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

GraphQL over WebSockets - The Guild Blog (the-guild.dev)

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:

2 Likes

Here’s a nice comparison article about performance of GraphQL over HTTP vs Websocket (It includes REST as well :sweat_smile: ): https://www.openshift.com/blog/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.