The GraphQl interface provides GraphQl query and mutation functionality.

Since SDK 1.3.1 all functions in the GraphQl interface returning LiveData are deprecated . Use either the suspending functions with Coroutines or one of the *WithCallback() alternative functions.

You should use the default functions using Kotlin Coroutines:

val exampleAppQuery: ExampleAppQuery = ExampleAppQuery.builder().build()

fragmentScope.launch {
		.collect { result ->
			result.errors.forEach { error ->
				// do something with the errors
			} { data ->
				// do something with the data

If you can’t use Coroutines or you are programming Java only, you can use the corresponding functions using Callback:

val cancelable: Cancelable = smartSpacesSdk
	.queryWithCallback(exampleAppQuery) { result: Result<ExampleAppQuery.Data> ->
		// do something with the result

You can pass an optional updateIntervalMillis parameter to the query functions. It will constantly trigger that query in the given interval.

Do not forget calling cancel() on the CoroutineScope or the Cancelable or you will leak memory!