Skip to content

Instantly share code, notes, and snippets.

@Lavanyagaur22
Created April 6, 2019 12:24
Show Gist options
  • Save Lavanyagaur22/d1aa788bd17145c0c6305c9d34c99d46 to your computer and use it in GitHub Desktop.
Save Lavanyagaur22/d1aa788bd17145c0c6305c9d34c99d46 to your computer and use it in GitHub Desktop.
private fun createtask(title: String, description: String) {
Log.e(TAG, "inside create task")
val client = Utils.getApolloClient(this)?.mutate(
CreateTask.builder().title(title).description(description).build()
)
client?.enqueue(object : ApolloCall.Callback<CreateTask.Data>() {
override fun onFailure(e: ApolloException) {
Log.e("onFailure" + "createTask", e.toString())
}
override fun onResponse(response: Response<CreateTask.Data>) {
val result = response.data()?.createTask()
Log.e(TAG, "${result?.id()}")
Log.e(TAG, "${result?.title()}")
Log.e(TAG, "${result?.description()}")
Log.e(TAG, "${result?.version()}")
}
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment