QuerySubscription

interface QuerySubscription<Data : Any?, Variables : Any?>


A facility to subscribe to a query to be notified of updates to the query's data when the query is executed.

Notifications are not Realtime

At this time the notifications are not realtime, and are not pushed from the server. Instead, the notifications are sent whenever the query is explicitly executed by calling QueryRef.execute.

Safe for Concurrent Use

All methods and properties of QuerySubscription are thread-safe and may be safely called and/or accessed concurrently from multiple threads and/or coroutines.

Not Stable for Inheritance

The QuerySubscription interface is not stable for inheritance in third-party libraries, as new methods might be added to this interface or contracts of the existing methods can be changed.

Summary

Public functions

operator Boolean
equals(other: Any?)

Compares this object with another object for equality, using the === operator.

Int

Calculates and returns the hash code for this object.

String

Returns a string representation of this object, useful for debugging.

Public properties

Flow<QuerySubscriptionResult<Data, Variables>>

A cold flow that collects the query results as they become available.

QueryRef<Data, Variables>

The query whose results this object subscribes.

Public functions

equals

operator fun equals(other: Any?): Boolean

Compares this object with another object for equality, using the === operator.

The implementation of this method simply uses referential equality. That is, two instances of QuerySubscription compare equal using this method if, and only if, they refer to the same object, as determined by the === operator.

Parameters
other: Any?

The object to compare to this for equality.

Returns
Boolean

other === this

hashCode

fun hashCode(): Int

Calculates and returns the hash code for this object.

Returns
Int

the hash code for this object.

toString

fun toString(): String

Returns a string representation of this object, useful for debugging.

The string representation is not guaranteed to be stable and may change without notice at any time. Therefore, the only recommended usage of the returned string is debugging and/or logging. Namely, parsing the returned string or storing the returned string in non-volatile storage should generally be avoided in order to be robust in case that the string representation changes.

Returns
String

a string representation of this object, which includes the class name and the values of all public properties.

Public properties

flow

val flowFlow<QuerySubscriptionResult<Data, Variables>>

A cold flow that collects the query results as they become available.

At this time the updates are not realtime, and are not pushed from the server. Instead, updates are sent whenever the query is explicitly executed by calling QueryRef.execute.

query

val queryQueryRef<Data, Variables>

The query whose results this object subscribes.