<@U0RQY0KK5> I could use some help with subscripti...
# prisma-whats-new
l
@nilan I could use some help with subscriptions using native web sockets. I don't understand the handshake that I need to do, and I'm getting a 400 error when trying to establish an initial web socket connection to my project's endpoint
n
@lastmjs hey let's do this together 😄 would be cool to create a bare example in the docs, can you help me with that?
we can inspect the needed handshake in this live demo: https://demo.graph.cool/worldchat/
l
Yep, sounds great. Sorry, it was really late in the US. I'll pick this up in an hour or two
n
awesome! 🙂
l
Alright, I'm ready. Where do we begin?
l
Great, I'll look into that and the demo code and try to figure it out.
n
it's important to know that
subscription-transport-ws
uses a different protocol for
0.6.0
and
0.7.0
and Graphcool currently only supports the
0.6.0
protocol
it's not clear to me which version
PROTOCOL.md
refers to
yep it seems to be
init
,
subscription_start
,
init_success
,
subscription_success
,
subscription_data
,
keepalive
and
subscription_end
. Also, there is
subscription_fail
. This is all for
0.6.0
.
l
Good point, just running into issues with that
Looks like the 0.6.0 protocol might be deprecated
It's working though, making progress!
Where are you getting the 0.6.0? Are you talking about the subscriptions-transport-ws repo? I only see version .7 and then immediately preceeding that 0.5.4
I've got the handshake figured out, now I'm going to try and do a subscription. Want me to make a pull request to the docs once I'm finished?
Also, should I open an issue or something so that updating the protocol gets put on the roadmap, if it isn't already?
n
Yes we're aware of that, there's already a long discussion here: https://github.com/apollographql/subscriptions-transport-ws/issues/149
a PR sounds great, this is the right repo: github.com/graphcool/content
I'll probably shuffle it around in the reference docs
👍 1
l
I really appreciate the help, I've got it figured out and working in my app. Here's the pull request: https://github.com/graphcool/content/pull/142 Feel free to do what you want with you, just my initial thoughts on where it should go