Interface ApolloCall<T>

  • All Superinterfaces:
    Cancelable
    All Known Subinterfaces:
    ApolloMutationCall<T>, ApolloQueryCall<T>
    All Known Implementing Classes:
    RealApolloCall

    public interface ApolloCall<T>
    extends Cancelable

    ApolloCall is an abstraction for a request that has been prepared for execution. ApolloCall represents a single request/response pair and cannot be executed twice, though it can be cancelled.

    In order to execute the request again, call the clone() method which creates a new ApolloCall object.

    • Method Detail

      • enqueue

        void enqueue​(@Nullable
                     ApolloCall.Callback<T> callback)
        Schedules the request to be executed at some point in the future.
        Parameters:
        callback - Callback which will handle the response or a failure exception.
        Throws:
        java.lang.IllegalStateException - when the call has already been executed
      • cacheHeaders

        @Deprecated
        @NotNull
        ApolloCall<T> cacheHeaders​(@NotNull
                                   com.apollographql.apollo.cache.CacheHeaders cacheHeaders)
        Deprecated.
        Sets the CacheHeaders to use for this call. com.apollographql.apollo.interceptor.FetchOptions will be configured with this headers, and will be accessible from the ResponseFetcher used for this call. Deprecated, use toBuilder() to mutate the ApolloCall
        Parameters:
        cacheHeaders - the CacheHeaders that will be passed with records generated from this request to NormalizedCache. Standardized cache headers are defined in ApolloCacheHeaders.
        Returns:
        The ApolloCall object with the provided CacheHeaders.
      • clone

        @Deprecated
        @NotNull
        ApolloCall<T> clone()
        Deprecated.
        Creates a new, identical call to this one which can be enqueued or executed even if this call has already been. Deprecated, use toBuilder() to mutate the ApolloCall
        Returns:
        The cloned ApolloCall object.
      • operation

        @NotNull
        com.apollographql.apollo.api.Operation operation()
        Returns GraphQL operation this call executes
        Returns:
        Operation