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
      void onCompleted()
      Gets called when final GraphQL response is received.
      void onConnected()
      Gets called when GraphQL subscription server connection is opened.
      void onFailure​(com.apollographql.apollo.exception.ApolloException e)
      Gets called when an unexpected exception occurs while creating the request or processing the response.
      void onResponse​(com.apollographql.apollo.api.Response<T> response)
      Gets called when GraphQL response is received and parsed successfully.
      void onTerminated()
      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, neither onResponse(Response) or onCompleted() 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.