com.apollographql.subscription.message.CallbackMessageComplete Maven / Gradle / Ivy
package com.apollographql.subscription.message;
import graphql.GraphQLError;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* complete
message is send to the Router to terminate active
* subscription. Subscription can terminate either by reaching end of the data stream OR by
* encountering an error that caused subscription to fail.
* If subscription failed due to an error, complete
message should include list of
* GraphQLError
s that caused the failure.
*
* @param id unique subscription ID
* @param verifier value provided by Router that is used to validate requests
* @param errors optional list of errors if subscription terminated abnormally
*/
public record CallbackMessageComplete(String id, String verifier, List errors)
implements SubscritionCallbackMessage {
public CallbackMessageComplete(String id, String verifier) {
this(id, verifier, Collections.emptyList());
}
@Override
public CallbackMessageAction getAction() {
return CallbackMessageAction.COMPLETE;
}
@Override
public String getId() {
return id;
}
@Override
public String getVerifier() {
return verifier;
}
public List