Sensorberg Smart Spaces SDK for Android / com.sensorberg.smartspaces.sdk / GraphQl

GraphQl

interface GraphQl

Functions

mutate

Execute a GraphQl mutation. The mutation will not be executed before user is successfully logged in.

abstract suspend fun <D : Data, T, V : Variables> mutate(mutation: Mutation<D, T, V>): Result<T>

mutateLiveData

Execute a client defined GraphQl mutation.

abstract fun <D : Data, T, V : Variables> mutateLiveData(mutation: Mutation<D, T, V>): LiveData<SimpleResponse<T>>

mutateWithCallback

Execute a GraphQl mutation. It will run off the main Thread and gives the result back on the main thread. The mutation will not be executed before user is successfully logged in. You must cancel this operation when its no longer needed or you will get memory leaks!

abstract fun <D : Data, T, V : Variables> mutateWithCallback(mutation: Mutation<D, T, V>, callback: (Result<T>) -> Unit): Cancelable

query

Execute a GraphQl query. The mutation will not be executed before user is successfully logged in.

abstract suspend fun <D : Data, T, V : Variables> query(query: Query<D, T, V>, updateIntervalMillis: Long = -1): Flow<Result<T>>

queryLiveData

Execute a client defined GraphQl query. Returns a LiveData with the status of the operation.

abstract fun <D : Data, T, V : Variables> queryLiveData(query: Query<D, T, V>): LiveData<SimpleResponse<T>>

queryWithCallback

Execute a GraphQl query. It will run off the main Thread and gives the result back on the main thread. You must cancel this operation when its no longer needed or you will get memory leaks!

abstract fun <D : Data, T, V : Variables> queryWithCallback(query: Query<D, T, V>, callback: (Result<T>) -> Unit): Cancelable
abstract fun <D : Data, T, V : Variables> queryWithCallback(query: Query<D, T, V>, updateIntervalMillis: Long, callback: (Result<T>) -> Unit): Cancelable