Class SubscriptionPublisher

  • All Implemented Interfaces:
    org.reactivestreams.Publisher<ExecutionResult>

    @PublicApi
    public class SubscriptionPublisher
    extends java.lang.Object
    implements org.reactivestreams.Publisher<ExecutionResult>
    Subscription queries return an instance of this class in the ExecutionResult data element for the subscribed field.
    
          ExecutionResult er = graphQL.execute("subscription s { onEntityChanged(id : "1") { selection1, selection2 }}")
          SubscriptionPublisher eventPublisher = er.getData("onEntityChanged")
     
     
    • Constructor Summary

      Constructors 
      Constructor Description
      SubscriptionPublisher​(org.reactivestreams.Publisher<java.lang.Object> upstreamPublisher, java.util.function.Function<java.lang.Object,​java.util.concurrent.CompletionStage<ExecutionResult>> mapper)
      Subscription consuming code is not expected to create instances of this class
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.reactivestreams.Publisher<java.lang.Object> getUpstreamPublisher()  
      void subscribe​(org.reactivestreams.Subscriber<? super ExecutionResult> subscriber)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SubscriptionPublisher

        public SubscriptionPublisher​(org.reactivestreams.Publisher<java.lang.Object> upstreamPublisher,
                                     java.util.function.Function<java.lang.Object,​java.util.concurrent.CompletionStage<ExecutionResult>> mapper)
        Subscription consuming code is not expected to create instances of this class
        Parameters:
        upstreamPublisher - the original publisher of objects that then have a graphql selection set applied to them
        mapper - a mapper that turns object into promises to execution results which are then published on this stream
    • Method Detail

      • getUpstreamPublisher

        public org.reactivestreams.Publisher<java.lang.Object> getUpstreamPublisher()
        Returns:
        the underlying Publisher that was providing raw objects to the subscription field, whose published values are then mapped to execution results
      • subscribe

        public void subscribe​(org.reactivestreams.Subscriber<? super ExecutionResult> subscriber)
        Specified by:
        subscribe in interface org.reactivestreams.Publisher<ExecutionResult>