SkillAgentSearch skills...

LiveGQL

Simple java library in order to use GraphQL Subscription on WebSocket based on Apollo Protocol.

Install / Use

/learn @billybichon/LiveGQL
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

Platform Technology License

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:

  • Tyrus for managing websocket
  • Gson for handling json object

Bugs

  • Error are not handled but your app won't crash (because it's on the stream ;))
View on GitHub
GitHub Stars18
CategoryDevelopment
Updated5y ago
Forks5

Languages

Java

Security Score

60/100

Audited on Jul 6, 2020

No findings