Reading through the docs about “Subscriptions in A...
# apollo-kotlin
s
Reading through the docs about “Subscriptions in Apollo Kotlin” https://www.apollographql.com/docs/kotlin/essentials/subscriptions I see that there’s a mention about SubscriptionWsProtocol and GraphQLWsProtocol and how the former is no longer maintained and we should switch over to GraphQLWsProtocol when we can. There’s a section which says “If your server already uses `graphql-ws`” to switch to it, but how do I know if my backend has support for that or not? Is there a way for me to figure that out without having to look into the backend code itself?
b
I don't think there's an easy way other than the docs, or the sourcecode 😅
well... you could also just try it I guess!
s
Heh yeah that would work 😄 My issue is that I’ve been encountering some issues with our subscriptions. It’s issues on the backend, but just doing some sanity checks that we are not doing any wrong configuration on our end and I stumbled upon this section so I got curious 😄 Right now no subscription works for us so trying it won’t really help me, but once it works again I can give it a shot 😄
b
If you use the wrong protocol you should get an error right away (* in most cases, but this depends on the server too!)
s
Yeah, that makes sense. Since it’s that easy I just tried it, because why not. It doesn’t seem to crash, but just like before I do not get any subscription responses, so again, really need to get backend fixed before I can try further 😅 No way to tell if that’s an issue or not 🤷
b
yeah the situation with Subscriptions is really not great IMO. The spec says nothing about the protocol (on purpose!) and therefore it's kind of a mess right now.
s
I am fairly certain in this very particular case our backend is the one with the issues since iOS is also experiencing them all of a sudden, so no worries on your end 😅 With that said, about this mess, is there a clear path forward then? What do you feel like the situation will be in say 1 year from now?
b
I'm not very optimistic to be honest 😂
s
Well our subscriptions now work, and I can confirm that changing SubscriptionWsProtocol to GraphQLWsProtocol just makes it so that nothing comes back to us 😄 So now I know 😅 I guess the next question from my end then is, since this is not maintained anymore, how urgently should I share this with my backend devs to consider looking for alternatives? Let it be for now and maybe fix it once it may be broken? Should I be somewhat urgent with it? What’s your perspective on this and what do you think you could suggest to the library consumers like me? I understand that as you said it’s not a very clear topic in general, so even if you have personal opinions about it and not from the apollo-kotlin perspective specifically I’d still like to hear about it 😊
b
Thanks for the follow up! That's a totally valid and good question. On Apollo Kotlin's side we don't intend on removing or deprecating this protocol, even in the upcoming v4. In general, it's not too much of a burden for us to keep it maintained, at least as of now. So I would say there's no urgency on your side.
s
Ah that’s perfect. I was mostly worried because where this comes from speficially is not a very well maintained service, so if I had to ask for changes to be done it’d be a really hard ask for the backend team. This gives me good confidence for now, let’s hope in a year in the future I don’t come back here with more concerns 😅
b
That makes sense. The doc we put there says that at some point in the future we would change the default value, but we haven't done so yet. Not sure we'll actually do it in v4. But just to be sure, you may want to explicitly set the protocol on your side so if the default change, you won't be impacted.
s
Yeap, sounds good to even change the default, just as long as the docs still mention what they do now regarding two options existing and that the old one is not actively maintained
b
(thinking about it, maybe we should NOT have a default protocol, and force the user to make a conscious choice, given the current state of affairs)
s
Oh yeah, that sounds even better to me