Created
April 6, 2019 08:30
-
-
Save Lavanyagaur22/ab697253f6a6cef7823ed17bd84701ea to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun updateTask(id: String, title: String, version: Int) { | |
Log.e(TAG, "inside update task") | |
val client = Utils.getApolloClient(this)?.mutate( | |
UpdateCurrentTask.builder().id(id).title(title).version(version).build() | |
) | |
client?.enqueue(object : ApolloCall.Callback<UpdateCurrentTask.Data>() { | |
override fun onFailure(e: ApolloException) { | |
Log.e("onFailure" + "updateTask", e.toString()) | |
} | |
override fun onResponse(response: Response<UpdateCurrentTask.Data>) { | |
val result = response.data()?.updateTask() | |
Log.e(TAG, "${result?.id()}") | |
Log.e(TAG, "${result?.title()}") | |
Log.e(TAG, "${result?.description()}") | |
Log.e(TAG, "${result?.version()}") | |
runOnUiThread { | |
noteslist.clear() | |
getTasks() | |
} | |
} | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment