Hi, how can I use GraphQL in KMM projects. Because...
# multiplatform
h
Hi, how can I use GraphQL in KMM projects. Because Apollo requires iOS 13+ we’re looking for an alternative.
m
Do you need subscriptions ? iOS 13 is only required for WebSockets. It might work if you don't use subscriptions. Worst case, we could move websockets to a separate module
h
Yeah, websocket will be used heavily in the project. Is there any libraries to convert data models to GraphQL queries? If we want to use Ktor instead of Apollo
m
Can Ktor do WebSocket on iOS ? Reading https://ktor.io/docs/websocket-client.html#usage I'm not sure
h
You’re right, relating to this issue https://github.com/ktorio/ktor/issues/1894 it doesn’t support websocket on iOS. Is there any alternative way?
m
If you need subscriptions on iOS < 13, you'll have to write your own WebSockets code. Either using plain C sockets or maybe linking with starscream, a WebSocket library on iOS
h
m
This is what Apollo Android does. It requires iOS 13
h
Why it's not compatible with iOS < 13? According to the apple docs NSURLSession is available on iOS 7.0+ https://developer.apple.com/documentation/foundation/nsurlsession
h
Right, thanks 🙏