LiveGQL
Simple java library in order to use GraphQL Subscription on WebSocket based on Apollo Protocol.
Install / Use
/learn @billybichon/LiveGQLREADME

This a simple java library in order to use GraphQL Subscription on WebSocket based on Apollo Protocol.
Features
- [x] connect to a GraphQL server
- [ ] Handle init payload
- [x] Subscribe/Unsubscribe
- [x] Close connection
- [x] Error handling
- [ ] Json handling
- [ ] Manage generic types
Requirements
jdk version >= 1.8
iOS
You'll find the iOS version for this library here: iOS liveGQL
How to install
Gradle
dependency {
compile 'com.github.billybichon:livegql:1.1'
}
maven
<dependency>
<groupId>com.github.billybichon</groupId>
<artifactId>livegql</artifactId>
<version>1.1</version>
</dependency>
manually
Just copy the livegql-1.1.jar inside your libs folder and be sure to use:
dependency {
compile fileTree(dir: 'libs', include: ['*.jar'])
}
How to use
Initialize
LiveGQL liveGQL = new LiveGQL("ws://your.url", new LiveGQLListener() {
// override methods
}
);
subscription
// subscribe
Subscription subscription = liveGQL.subscribe("query to subscribe", "tag");
// Unsubscribe
liveGQL.unsubscribe(subscription);
close connection
liveGQL.closeConnection();
Dependency
Libraries on which liveGQL depends:
Bugs
- Error are not handled but your app won't crash (because it's on the stream ;))
