Package com.apollographql.apollo
Interface ApolloSubscriptionCall.Callback<T>
-
- Enclosing interface:
- ApolloSubscriptionCall<T>
public static interface ApolloSubscriptionCall.Callback<T>Communicates responses from a subscription server.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidonCompleted()Gets called when final GraphQL response is received.voidonConnected()Gets called when GraphQL subscription server connection is opened.voidonFailure(com.apollographql.apollo.exception.ApolloException e)Gets called when an unexpected exception occurs while creating the request or processing the response.voidonResponse(com.apollographql.apollo.api.Response<T> response)Gets called when GraphQL response is received and parsed successfully.voidonTerminated()Gets called when GraphQL subscription server connection is closed unexpectedly.
-
-
-
Method Detail
-
onResponse
void onResponse(@NotNull com.apollographql.apollo.api.Response<T> response)Gets called when GraphQL response is received and parsed successfully. This may be called multiple times.onCompleted()will be called after the final call to onResponse.- Parameters:
response- the GraphQL response
-
onFailure
void onFailure(@NotNull com.apollographql.apollo.exception.ApolloException e)Gets called when an unexpected exception occurs while creating the request or processing the response. Will be called at most one time. It is considered a terminal event. After called, neitheronResponse(Response)oronCompleted()will be called again.
-
onCompleted
void onCompleted()
Gets called when final GraphQL response is received. It is considered a terminal event.
-
onTerminated
void onTerminated()
Gets called when GraphQL subscription server connection is closed unexpectedly. It is considered to re-try the subscription later.
-
onConnected
void onConnected()
Gets called when GraphQL subscription server connection is opened.
-
-