use of com.example.aleksejkocergin.myapplication.ToggleLikeMutation in project RandomWebm by alkocher.
the class ToggleVotesUtil method toggleLike.
public void toggleLike(String webmId, boolean hasLike, boolean hasDislike) {
ApolloMutationCall<ToggleLikeMutation.Data> likeMutationCall = WebmApolloClient.getWebmApolloClient().mutate(new ToggleLikeMutation(webmId, hasLike, hasDislike));
mDisposable.add(Rx2Apollo.from(likeMutationCall).observeOn(AndroidSchedulers.mainThread()).subscribeOn(Schedulers.io()).subscribeWith(new DisposableObserver<Response<ToggleLikeMutation.Data>>() {
@Override
public void onNext(Response<ToggleLikeMutation.Data> dataResponse) {
}
@Override
public void onError(Throwable e) {
webmData.showErrorSnackbar();
}
@Override
public void onComplete() {
webmData.showSuccessSnackbar();
}
}));
}
Aggregations