public interface GraphQLSubscription.Handler<T>
Receives the events of one subscription. All methods run on the
Codename One EDT.
Methods
public abstract void onNext(GraphQLResponse<T> response) | A next payload arrived and its data mapped to T. |
public abstract void onError(GraphQLResponse<T> response) | The subscription failed (an error message, a transport error, or a non-clean close). |
public abstract void onComplete() | The subscription ended cleanly (server complete, or a caller cancel()). |
Method details
onNext
public abstract void onNext(GraphQLResponse<T> response)A
next payload arrived and its data mapped to T. When
the payload also carried errors, response.hasErrors() is
true and response.getData() may still be non-null.onError
public abstract void onError(GraphQLResponse<T> response)The subscription failed (an
error message, a transport
error, or a non-clean close). No further events follow.onComplete
public abstract void onComplete()The subscription ended cleanly (server
complete, or a
caller cancel()). No further events follow.