florianmari / livegql Goto Github PK
View Code? Open in Web Editor NEWUse GraphQL Subscriptions on iOS :ok_hand:
License: MIT License
Use GraphQL Subscriptions on iOS :ok_hand:
License: MIT License
Hi, this is an awesome library and very easy to setup - congrats! Just giving it a try and connecting to an Apollo graphql server, I seem to get random disconnects - if the app is run for a minute or so I can pretty much guarantee it'll lose the connection. Is there anything I can do to avoid this do you know?
great library! ๐ would be nice to support the latest starscream.
Hi,
So I am trying to link the LiveGQL framework with the Example project and not using the Cocoapod.
Now since LiveGQL only links with Starscream, if I do not include starscream separately in the Example application, it crashes at run time saying Starscream not found.
But if I do include Starscream via the Pods project, I get a compilation error :
/Users/mjolnir/workspace/referron/LiveGQL/Example/Pods/Starscream/zlib/module.modulemap:1:8: error: redefinition of module 'SSCZLib' module SSCZLib [system] { ^ /Users/mjolnir/workspace/referron/LiveGQL/Carthage/Checkouts/Starscream/zlib/module.modulemap:1:8: note: previously defined here module SSCZLib [system] { ^ /Users/mjolnir/workspace/referron/LiveGQL/Example/Pods/Starscream/zlib/module.modulemap:6:8: error: redefinition of module 'SSCommonCrypto' module SSCommonCrypto [system] { ^ /Users/mjolnir/workspace/referron/LiveGQL/Carthage/Checkouts/Starscream/zlib/module.modulemap:6:8: note: previously defined here module SSCommonCrypto [system] { ^ <unknown>:0: error: could not build Objective-C module 'Starscream'
So somehow, LiveGQL ends up including the modulemap for Starscream too which causes problems if we include Starscream with the Application project also.
Can you please help with what might be missing in the setup ? Or do we need to make changes in the LiveGQL project ?
Essentially, I need to be able to link the LiveGQL framework directly with my application and make it work.
When connecting to a socket often we need to have some sort of authentication. The javascript client allows for connection parameters to be sent over to perform authentication.
http://dev.apollodata.com/tools/graphql-subscriptions/authentication.html
I think it would be good if the iOS client would allow similar option. Send payload in initServer
function?
Hey @florianmari! I love the idea of combining sockets and GraphQL. Would you consider adding support for Carthage dependency manager? It would be super-cool to have it as option.
It only requires to have library .xcodeproj
in the repository with shared schemes for all supported platforms.
If you are interested, I can make PR.
Are you planning to implement heartbeat to keep a websocket connection open?
I have such crash. It occurring in ~1 minute after running app if I specify reconnect: true
in gql.initServer(connectionParams: nil, reconnect: true)
If I set reconnect to false, there won't be crash, but subscription will stop in 1 minute without any notice.
*** Assertion failure in -[SRWebSocket open], /Pods/SocketRocket/SocketRocket/SRWebSocket.m:389
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Cannot call -(void)open on SRWebSocket more than once'
*** First throw call stack:
(
0 CoreFoundation 0x000000010444c12b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x0000000100e17f41 objc_exception_throw + 48
2 CoreFoundation 0x00000001044512f2 +[NSException raise:format:arguments:] + 98
3 Foundation 0x00000001008b8d69 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 193
4 SocketRocket 0x00000001007ca323 -[SRWebSocket open] + 355
5 LiveGQL 0x000000010079d8e0 _T07LiveGQLAAC9webSocketySQySo05SRWebD0CG_Si16didCloseWithCodeSQySSG6reasonSb8wasCleantF + 192
6 LiveGQL 0x000000010079d9fd _T07LiveGQLAAC9webSocketySQySo05SRWebD0CG_Si16didCloseWithCodeSQySSG6reasonSb8wasCleantFTo + 253
7 SocketRocket 0x00000001007d3fcb __34-[SRWebSocket stream:handleEvent:]_block_invoke_3 + 187
8 libdispatch.dylib 0x0000000105c2c2f7 _dispatch_call_block_and_release + 12
9 libdispatch.dylib 0x0000000105c2d33d _dispatch_client_callout + 8
10 libdispatch.dylib 0x0000000105c385f9 _dispatch_main_queue_callback_4CF + 628
11 CoreFoundation 0x000000010440ee39 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
12 CoreFoundation 0x00000001043d3462 __CFRunLoopRun + 2402
13 CoreFoundation 0x00000001043d2889 CFRunLoopRunSpecific + 409
14 GraphicsServices 0x0000000109a779c6 GSEventRunModal + 62
15 UIKit 0x00000001016b45d6 UIApplicationMain + 159
16 xxxxxxxx 0x00000001003842c7 main + 55
17 libdyld.dylib 0x0000000105ca9d81 start + 1
18 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException`
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.