Created
June 9, 2019 16:25
-
-
Save Lavanyagaur22/82cacfc21ac792a39774eb7a3de254c7 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
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() | |
)?.refetchQueries(object : OperationName { | |
override fun name(): String { | |
return AllTasksQuery.OPERATION_DEFINITION | |
} | |
}) | |
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, "onResponse-CreateTask") | |
Log.e(TAG, "${result?.id()}") | |
Log.e(TAG, "${result?.title()}") | |
Log.e(TAG, "${result?.description()}") | |
Log.e(TAG, "${result?.version()}") | |
getTasks() | |
runOnUiThread { | |
noteslist.clear() | |
getTasks() | |
Log.e(TAG, "createTask : ${noteslist.size}") | |
} | |
} | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment